generic_method.carbon 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083
  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/min_prelude/destroy.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/interface/min_prelude/generic_method.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/min_prelude/generic_method.carbon
  12. // --- generic_method_fewer_params.carbon
  13. library "[[@TEST_NAME]]";
  14. // T has index 0, Self has index 1, U has index 2.
  15. interface A(T:! type) {
  16. fn F(U:! type, u: U) -> (T, Self, U);
  17. }
  18. class X {}
  19. class Y {}
  20. class Z {}
  21. impl Y as A(X) {
  22. // Here, U has index 0. The specific used for A.F needs to renumber its U from
  23. // index 2 to index 0.
  24. fn F(U:! type, u: U) -> (X, Y, U) {
  25. return ({}, {}, u);
  26. }
  27. }
  28. fn Call() {
  29. (Y as A(X)).F(Z, {});
  30. }
  31. fn CallGeneric(T:! A(X)) {
  32. T.F(Z, {});
  33. }
  34. fn CallIndirect() {
  35. CallGeneric(Y);
  36. }
  37. // --- generic_method_more_params.carbon
  38. library "[[@TEST_NAME]]";
  39. // T has index 0, Self has index 1, U has index 2.
  40. interface A(T:! type) {
  41. fn F(U:! type, u: U) -> (T, Self, U);
  42. }
  43. class X {}
  44. class Y1 {}
  45. class Y2 {}
  46. class Z {}
  47. impl forall [V1:! type, V2:! type, W:! type] (V1, V2) as A(W) {
  48. // Here, U has index 3. The specific used for A.F needs to renumber its U from
  49. // index 2 to index 3.
  50. fn F(U:! type, u: U) -> (W, (V1, V2), U) {
  51. return F(U, u);
  52. }
  53. }
  54. fn Call() {
  55. // TODO: The `as type` here should not be necessary.
  56. (((Y1, Y2) as type) as A(X)).F(Z, {});
  57. }
  58. fn CallGeneric(T:! A(X)) {
  59. T.F(Z, {});
  60. }
  61. fn CallIndirect() {
  62. // TODO: The `as type` here should not be necessary.
  63. CallGeneric((Y1, Y2) as type);
  64. }
  65. // CHECK:STDOUT: --- generic_method_fewer_params.carbon
  66. // CHECK:STDOUT:
  67. // CHECK:STDOUT: constants {
  68. // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
  69. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  70. // CHECK:STDOUT: %A.type.495: type = generic_interface_type @A [concrete]
  71. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  72. // CHECK:STDOUT: %A.generic: %A.type.495 = struct_value () [concrete]
  73. // CHECK:STDOUT: %A.type.75a: type = facet_type <@A, @A(%T.8b3)> [symbolic]
  74. // CHECK:STDOUT: %Self.753: %A.type.75a = bind_symbolic_name Self, 1 [symbolic]
  75. // CHECK:STDOUT: %U.2cb: type = bind_symbolic_name U, 2 [symbolic]
  76. // CHECK:STDOUT: %pattern_type.20f: type = pattern_type %U.2cb [symbolic]
  77. // CHECK:STDOUT: %tuple.type.e59: type = tuple_type (type, %A.type.75a, type) [symbolic]
  78. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.753 [symbolic]
  79. // CHECK:STDOUT: %tuple.type.bd2: type = tuple_type (%T.8b3, %Self.as_type, %U.2cb) [symbolic]
  80. // CHECK:STDOUT: %pattern_type.44c: type = pattern_type %tuple.type.bd2 [symbolic]
  81. // CHECK:STDOUT: %F.type.17a: type = fn_type @F.1, @A(%T.8b3) [symbolic]
  82. // CHECK:STDOUT: %F.0d8: %F.type.17a = struct_value () [symbolic]
  83. // CHECK:STDOUT: %A.assoc_type.ed3: type = assoc_entity_type @A, @A(%T.8b3) [symbolic]
  84. // CHECK:STDOUT: %assoc0.fcb: %A.assoc_type.ed3 = assoc_entity element0, @A.%F.decl [symbolic]
  85. // CHECK:STDOUT: %X: type = class_type @X [concrete]
  86. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  87. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  88. // CHECK:STDOUT: %Y: type = class_type @Y [concrete]
  89. // CHECK:STDOUT: %Z: type = class_type @Z [concrete]
  90. // CHECK:STDOUT: %A.type.91f: type = facet_type <@A, @A(%X)> [concrete]
  91. // CHECK:STDOUT: %Self.1bb: %A.type.91f = bind_symbolic_name Self, 1 [symbolic]
  92. // CHECK:STDOUT: %F.type.13d: type = fn_type @F.1, @A(%X) [concrete]
  93. // CHECK:STDOUT: %F.d83: %F.type.13d = struct_value () [concrete]
  94. // CHECK:STDOUT: %A.assoc_type.296: type = assoc_entity_type @A, @A(%X) [concrete]
  95. // CHECK:STDOUT: %assoc0.5f6: %A.assoc_type.296 = assoc_entity element0, @A.%F.decl [concrete]
  96. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness file.%A.impl_witness_table [concrete]
  97. // CHECK:STDOUT: %U.8b3: type = bind_symbolic_name U, 0 [symbolic]
  98. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %U.8b3 [symbolic]
  99. // CHECK:STDOUT: %tuple.type.ff9: type = tuple_type (type, type, type) [concrete]
  100. // CHECK:STDOUT: %tuple.type.765: type = tuple_type (%X, %Y, %U.8b3) [symbolic]
  101. // CHECK:STDOUT: %pattern_type.340: type = pattern_type %tuple.type.765 [symbolic]
  102. // CHECK:STDOUT: %F.type.436: type = fn_type @F.2 [concrete]
  103. // CHECK:STDOUT: %F.ce9: %F.type.436 = struct_value () [concrete]
  104. // CHECK:STDOUT: %A.facet.552: %A.type.91f = facet_value %Y, (%A.impl_witness) [concrete]
  105. // CHECK:STDOUT: %tuple.type.a0c: type = tuple_type (type, %A.type.91f, type) [concrete]
  106. // CHECK:STDOUT: %require_complete.816: <witness> = require_complete_type %tuple.type.765 [symbolic]
  107. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %U.8b3 [symbolic]
  108. // CHECK:STDOUT: %tuple.type.a41: type = tuple_type (%empty_struct_type, %empty_struct_type, %U.8b3) [symbolic]
  109. // CHECK:STDOUT: %X.val: %X = struct_value () [concrete]
  110. // CHECK:STDOUT: %Y.val: %Y = struct_value () [concrete]
  111. // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete]
  112. // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete]
  113. // CHECK:STDOUT: %.a60: type = fn_type_with_self_type %F.type.13d, %A.facet.552 [concrete]
  114. // CHECK:STDOUT: %pattern_type.8f9: type = pattern_type %Z [concrete]
  115. // CHECK:STDOUT: %tuple.type.f6b: type = tuple_type (%X, %Y, %Z) [concrete]
  116. // CHECK:STDOUT: %pattern_type.ef1: type = pattern_type %tuple.type.f6b [concrete]
  117. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ce9, @F.2(%Z) [concrete]
  118. // CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete]
  119. // CHECK:STDOUT: %T.9c2: %A.type.91f = bind_symbolic_name T, 0 [symbolic]
  120. // CHECK:STDOUT: %pattern_type.817: type = pattern_type %A.type.91f [concrete]
  121. // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete]
  122. // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete]
  123. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.9c2 [symbolic]
  124. // CHECK:STDOUT: %A.lookup_impl_witness: <witness> = lookup_impl_witness %T.9c2, @A, @A(%X) [symbolic]
  125. // CHECK:STDOUT: %A.facet.11f: %A.type.91f = facet_value %T.as_type, (%A.lookup_impl_witness) [symbolic]
  126. // CHECK:STDOUT: %.ffa: type = fn_type_with_self_type %F.type.13d, %A.facet.11f [symbolic]
  127. // CHECK:STDOUT: %impl.elem0: %.ffa = impl_witness_access %A.lookup_impl_witness, element0 [symbolic]
  128. // CHECK:STDOUT: %tuple.type.e28: type = tuple_type (%X, %T.as_type, %Z) [symbolic]
  129. // CHECK:STDOUT: %pattern_type.f25: type = pattern_type %tuple.type.e28 [symbolic]
  130. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @F.1(%X, %A.facet.11f, %Z) [symbolic]
  131. // CHECK:STDOUT: %require_complete.500: <witness> = require_complete_type %tuple.type.e28 [symbolic]
  132. // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete]
  133. // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete]
  134. // CHECK:STDOUT: %CallGeneric.specific_fn: <specific function> = specific_function %CallGeneric, @CallGeneric(%A.facet.552) [concrete]
  135. // CHECK:STDOUT: %complete_type.a64: <witness> = complete_type_witness %tuple.type.f6b [concrete]
  136. // CHECK:STDOUT: %tuple.type.9c8: type = tuple_type (%empty_struct_type, %empty_struct_type, %Z) [concrete]
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT:
  139. // CHECK:STDOUT: imports {
  140. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  141. // CHECK:STDOUT: import Core//prelude
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: file {
  146. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  147. // CHECK:STDOUT: .Core = imports.%Core
  148. // CHECK:STDOUT: .A = %A.decl
  149. // CHECK:STDOUT: .X = %X.decl
  150. // CHECK:STDOUT: .Y = %Y.decl
  151. // CHECK:STDOUT: .Z = %Z.decl
  152. // CHECK:STDOUT: .Call = %Call.decl
  153. // CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
  154. // CHECK:STDOUT: .CallIndirect = %CallIndirect.decl
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT: %Core.import = import Core
  157. // CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [concrete = constants.%A.generic] {
  158. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  159. // CHECK:STDOUT: } {
  160. // CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)]
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  163. // CHECK:STDOUT: %Y.decl: type = class_decl @Y [concrete = constants.%Y] {} {}
  164. // CHECK:STDOUT: %Z.decl: type = class_decl @Z [concrete = constants.%Z] {} {}
  165. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  166. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y]
  167. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  168. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  169. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  170. // CHECK:STDOUT: }
  171. // CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@impl.%F.decl), @impl [concrete]
  172. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness %A.impl_witness_table [concrete = constants.%A.impl_witness]
  173. // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {}
  174. // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] {
  175. // CHECK:STDOUT: %T.patt: %pattern_type.817 = symbolic_binding_pattern T, 0 [concrete]
  176. // CHECK:STDOUT: } {
  177. // CHECK:STDOUT: %.loc25: type = splice_block %A.type [concrete = constants.%A.type.91f] {
  178. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  179. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  180. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT: %T.loc25_16.1: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc25_16.2 (constants.%T.9c2)]
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {}
  185. // CHECK:STDOUT: }
  186. // CHECK:STDOUT:
  187. // CHECK:STDOUT: generic interface @A(%T.loc5_13.1: type) {
  188. // CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)]
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: !definition:
  191. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T.loc5_13.2)> [symbolic = %A.type (constants.%A.type.75a)]
  192. // CHECK:STDOUT: %Self.2: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.753)]
  193. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @A(%T.loc5_13.2) [symbolic = %F.type (constants.%F.type.17a)]
  194. // CHECK:STDOUT: %F: @A.%F.type (%F.type.17a) = struct_value () [symbolic = %F (constants.%F.0d8)]
  195. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A, @A(%T.loc5_13.2) [symbolic = %A.assoc_type (constants.%A.assoc_type.ed3)]
  196. // CHECK:STDOUT: %assoc0.loc6_39.2: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)]
  197. // CHECK:STDOUT:
  198. // CHECK:STDOUT: interface {
  199. // CHECK:STDOUT: %Self.1: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.753)]
  200. // CHECK:STDOUT: %F.decl: @A.%F.type (%F.type.17a) = fn_decl @F.1 [symbolic = @A.%F (constants.%F.0d8)] {
  201. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 2 [concrete]
  202. // CHECK:STDOUT: %u.patt: @F.1.%pattern_type.loc6_18 (%pattern_type.20f) = binding_pattern u [concrete]
  203. // CHECK:STDOUT: %u.param_patt: @F.1.%pattern_type.loc6_18 (%pattern_type.20f) = value_param_pattern %u.patt, call_param0 [concrete]
  204. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type.loc6_24 (%pattern_type.44c) = return_slot_pattern [concrete]
  205. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type.loc6_24 (%pattern_type.44c) = out_param_pattern %return.patt, call_param1 [concrete]
  206. // CHECK:STDOUT: } {
  207. // CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_13.1 [symbolic = %T (constants.%T.8b3)]
  208. // CHECK:STDOUT: %.loc6_31: @F.1.%A.type (%A.type.75a) = specific_constant @A.%Self.1, @A(constants.%T.8b3) [symbolic = %Self (constants.%Self.753)]
  209. // CHECK:STDOUT: %Self.ref: @F.1.%A.type (%A.type.75a) = name_ref Self, %.loc6_31 [symbolic = %Self (constants.%Self.753)]
  210. // CHECK:STDOUT: %U.ref.loc6_37: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  211. // CHECK:STDOUT: %.loc6_38.1: @F.1.%tuple.type.loc6_38.1 (%tuple.type.e59) = tuple_literal (%T.ref, %Self.ref, %U.ref.loc6_37)
  212. // CHECK:STDOUT: %Self.as_type.loc6_38.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  213. // CHECK:STDOUT: %.loc6_38.2: type = converted %Self.ref, %Self.as_type.loc6_38.2 [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  214. // CHECK:STDOUT: %.loc6_38.3: type = converted %.loc6_38.1, constants.%tuple.type.bd2 [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)]
  215. // CHECK:STDOUT: %U.loc6_8.2: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  216. // CHECK:STDOUT: %u.param: @F.1.%U.loc6_8.1 (%U.2cb) = value_param call_param0
  217. // CHECK:STDOUT: %U.ref.loc6_21: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  218. // CHECK:STDOUT: %u: @F.1.%U.loc6_8.1 (%U.2cb) = bind_name u, %u.param
  219. // CHECK:STDOUT: %return.param: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param call_param1
  220. // CHECK:STDOUT: %return: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot %return.param
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT: %assoc0.loc6_39.1: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)]
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: !members:
  225. // CHECK:STDOUT: .Self = %Self.1
  226. // CHECK:STDOUT: .T = <poisoned>
  227. // CHECK:STDOUT: .F = %assoc0.loc6_39.1
  228. // CHECK:STDOUT: witness = (%F.decl)
  229. // CHECK:STDOUT: }
  230. // CHECK:STDOUT: }
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: impl @impl: %Y.ref as %A.type {
  233. // CHECK:STDOUT: %F.decl: %F.type.436 = fn_decl @F.2 [concrete = constants.%F.ce9] {
  234. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  235. // CHECK:STDOUT: %u.patt: @F.2.%pattern_type.loc16_18 (%pattern_type.7dc) = binding_pattern u [concrete]
  236. // CHECK:STDOUT: %u.param_patt: @F.2.%pattern_type.loc16_18 (%pattern_type.7dc) = value_param_pattern %u.patt, call_param0 [concrete]
  237. // CHECK:STDOUT: %return.patt: @F.2.%pattern_type.loc16_24 (%pattern_type.340) = return_slot_pattern [concrete]
  238. // CHECK:STDOUT: %return.param_patt: @F.2.%pattern_type.loc16_24 (%pattern_type.340) = out_param_pattern %return.patt, call_param1 [concrete]
  239. // CHECK:STDOUT: } {
  240. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  241. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y]
  242. // CHECK:STDOUT: %U.ref.loc16_34: type = name_ref U, %U.loc16_8.2 [symbolic = %U.loc16_8.1 (constants.%U.8b3)]
  243. // CHECK:STDOUT: %.loc16_35.1: %tuple.type.ff9 = tuple_literal (%X.ref, %Y.ref, %U.ref.loc16_34)
  244. // CHECK:STDOUT: %.loc16_35.2: type = converted %.loc16_35.1, constants.%tuple.type.765 [symbolic = %tuple.type.loc16 (constants.%tuple.type.765)]
  245. // CHECK:STDOUT: %U.loc16_8.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc16_8.1 (constants.%U.8b3)]
  246. // CHECK:STDOUT: %u.param: @F.2.%U.loc16_8.1 (%U.8b3) = value_param call_param0
  247. // CHECK:STDOUT: %U.ref.loc16_21: type = name_ref U, %U.loc16_8.2 [symbolic = %U.loc16_8.1 (constants.%U.8b3)]
  248. // CHECK:STDOUT: %u: @F.2.%U.loc16_8.1 (%U.8b3) = bind_name u, %u.param
  249. // CHECK:STDOUT: %return.param: ref @F.2.%tuple.type.loc16 (%tuple.type.765) = out_param call_param1
  250. // CHECK:STDOUT: %return: ref @F.2.%tuple.type.loc16 (%tuple.type.765) = return_slot %return.param
  251. // CHECK:STDOUT: }
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: !members:
  254. // CHECK:STDOUT: .X = <poisoned>
  255. // CHECK:STDOUT: .Y = <poisoned>
  256. // CHECK:STDOUT: .F = %F.decl
  257. // CHECK:STDOUT: witness = file.%A.impl_witness
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT:
  260. // CHECK:STDOUT: class @X {
  261. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  262. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  263. // CHECK:STDOUT: complete_type_witness = %complete_type
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: !members:
  266. // CHECK:STDOUT: .Self = constants.%X
  267. // CHECK:STDOUT: }
  268. // CHECK:STDOUT:
  269. // CHECK:STDOUT: class @Y {
  270. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  271. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  272. // CHECK:STDOUT: complete_type_witness = %complete_type
  273. // CHECK:STDOUT:
  274. // CHECK:STDOUT: !members:
  275. // CHECK:STDOUT: .Self = constants.%Y
  276. // CHECK:STDOUT: }
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: class @Z {
  279. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  280. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  281. // CHECK:STDOUT: complete_type_witness = %complete_type
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: !members:
  284. // CHECK:STDOUT: .Self = constants.%Z
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: generic fn @F.1(@A.%T.loc5_13.1: type, @A.%Self.1: @A.%A.type (%A.type.75a), %U.loc6_8.2: type) {
  288. // CHECK:STDOUT: %U.loc6_8.1: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  289. // CHECK:STDOUT: %pattern_type.loc6_18: type = pattern_type %U.loc6_8.1 [symbolic = %pattern_type.loc6_18 (constants.%pattern_type.20f)]
  290. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
  291. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T)> [symbolic = %A.type (constants.%A.type.75a)]
  292. // CHECK:STDOUT: %Self: @F.1.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.753)]
  293. // CHECK:STDOUT: %tuple.type.loc6_38.1: type = tuple_type (type, %A.type, type) [symbolic = %tuple.type.loc6_38.1 (constants.%tuple.type.e59)]
  294. // CHECK:STDOUT: %Self.as_type.loc6_38.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  295. // CHECK:STDOUT: %tuple.type.loc6_38.2: type = tuple_type (%T, %Self.as_type.loc6_38.1, %U.loc6_8.1) [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)]
  296. // CHECK:STDOUT: %pattern_type.loc6_24: type = pattern_type %tuple.type.loc6_38.2 [symbolic = %pattern_type.loc6_24 (constants.%pattern_type.44c)]
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: fn(%u.param: @F.1.%U.loc6_8.1 (%U.2cb)) -> @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2);
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: generic fn @F.2(%U.loc16_8.2: type) {
  302. // CHECK:STDOUT: %U.loc16_8.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc16_8.1 (constants.%U.8b3)]
  303. // CHECK:STDOUT: %pattern_type.loc16_18: type = pattern_type %U.loc16_8.1 [symbolic = %pattern_type.loc16_18 (constants.%pattern_type.7dc)]
  304. // CHECK:STDOUT: %tuple.type.loc16: type = tuple_type (constants.%X, constants.%Y, %U.loc16_8.1) [symbolic = %tuple.type.loc16 (constants.%tuple.type.765)]
  305. // CHECK:STDOUT: %pattern_type.loc16_24: type = pattern_type %tuple.type.loc16 [symbolic = %pattern_type.loc16_24 (constants.%pattern_type.340)]
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: !definition:
  308. // CHECK:STDOUT: %require_complete.loc16_24: <witness> = require_complete_type %tuple.type.loc16 [symbolic = %require_complete.loc16_24 (constants.%require_complete.816)]
  309. // CHECK:STDOUT: %require_complete.loc16_19: <witness> = require_complete_type %U.loc16_8.1 [symbolic = %require_complete.loc16_19 (constants.%require_complete.4ae)]
  310. // CHECK:STDOUT: %tuple.type.loc17: type = tuple_type (constants.%empty_struct_type, constants.%empty_struct_type, %U.loc16_8.1) [symbolic = %tuple.type.loc17 (constants.%tuple.type.a41)]
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: fn(%u.param: @F.2.%U.loc16_8.1 (%U.8b3)) -> %return.param: @F.2.%tuple.type.loc16 (%tuple.type.765) {
  313. // CHECK:STDOUT: !entry:
  314. // CHECK:STDOUT: %.loc17_14.1: %empty_struct_type = struct_literal ()
  315. // CHECK:STDOUT: %.loc17_18.1: %empty_struct_type = struct_literal ()
  316. // CHECK:STDOUT: %u.ref: @F.2.%U.loc16_8.1 (%U.8b3) = name_ref u, %u
  317. // CHECK:STDOUT: %.loc17_22.1: @F.2.%tuple.type.loc17 (%tuple.type.a41) = tuple_literal (%.loc17_14.1, %.loc17_18.1, %u.ref)
  318. // CHECK:STDOUT: %tuple.elem0: ref %X = tuple_access %return, element0
  319. // CHECK:STDOUT: %.loc17_14.2: init %X = class_init (), %tuple.elem0 [concrete = constants.%X.val]
  320. // CHECK:STDOUT: %.loc17_22.2: init %X = converted %.loc17_14.1, %.loc17_14.2 [concrete = constants.%X.val]
  321. // CHECK:STDOUT: %tuple.elem1: ref %Y = tuple_access %return, element1
  322. // CHECK:STDOUT: %.loc17_18.2: init %Y = class_init (), %tuple.elem1 [concrete = constants.%Y.val]
  323. // CHECK:STDOUT: %.loc17_22.3: init %Y = converted %.loc17_18.1, %.loc17_18.2 [concrete = constants.%Y.val]
  324. // CHECK:STDOUT: %tuple.elem2: ref @F.2.%U.loc16_8.1 (%U.8b3) = tuple_access %return, element2
  325. // CHECK:STDOUT: %.loc17_22.4: init @F.2.%U.loc16_8.1 (%U.8b3) = initialize_from %u.ref to %tuple.elem2
  326. // CHECK:STDOUT: %.loc17_22.5: init @F.2.%tuple.type.loc16 (%tuple.type.765) = tuple_init (%.loc17_22.2, %.loc17_22.3, %.loc17_22.4) to %return
  327. // CHECK:STDOUT: %.loc17_23: init @F.2.%tuple.type.loc16 (%tuple.type.765) = converted %.loc17_22.1, %.loc17_22.5
  328. // CHECK:STDOUT: return %.loc17_23 to %return
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT: }
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: fn @Call() {
  333. // CHECK:STDOUT: !entry:
  334. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y]
  335. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  336. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  337. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  338. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%Y, (constants.%A.impl_witness) [concrete = constants.%A.facet.552]
  339. // CHECK:STDOUT: %.loc22_6: %A.type.91f = converted %Y.ref, %A.facet [concrete = constants.%A.facet.552]
  340. // CHECK:STDOUT: %.loc22_14.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6]
  341. // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc22_14.1 [concrete = constants.%assoc0.5f6]
  342. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc22_6 [concrete = constants.%Y]
  343. // CHECK:STDOUT: %.loc22_14.2: type = converted %.loc22_6, %as_type [concrete = constants.%Y]
  344. // CHECK:STDOUT: %impl.elem0: %.a60 = impl_witness_access constants.%A.impl_witness, element0 [concrete = constants.%F.ce9]
  345. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z]
  346. // CHECK:STDOUT: %.loc22_21.1: %empty_struct_type = struct_literal ()
  347. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%Z) [concrete = constants.%F.specific_fn]
  348. // CHECK:STDOUT: %.loc22_22.1: ref %tuple.type.f6b = temporary_storage
  349. // CHECK:STDOUT: %.loc22_21.2: ref %Z = temporary_storage
  350. // CHECK:STDOUT: %.loc22_21.3: init %Z = class_init (), %.loc22_21.2 [concrete = constants.%Z.val]
  351. // CHECK:STDOUT: %.loc22_21.4: ref %Z = temporary %.loc22_21.2, %.loc22_21.3
  352. // CHECK:STDOUT: %.loc22_21.5: ref %Z = converted %.loc22_21.1, %.loc22_21.4
  353. // CHECK:STDOUT: %.loc22_21.6: %Z = bind_value %.loc22_21.5
  354. // CHECK:STDOUT: %F.call: init %tuple.type.f6b = call %specific_fn(%.loc22_21.6) to %.loc22_22.1
  355. // CHECK:STDOUT: %.loc22_22.2: ref %tuple.type.f6b = temporary %.loc22_22.1, %F.call
  356. // CHECK:STDOUT: return
  357. // CHECK:STDOUT: }
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: generic fn @CallGeneric(%T.loc25_16.1: %A.type.91f) {
  360. // CHECK:STDOUT: %T.loc25_16.2: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc25_16.2 (constants.%T.9c2)]
  361. // CHECK:STDOUT:
  362. // CHECK:STDOUT: !definition:
  363. // CHECK:STDOUT: %T.as_type.loc26_4.2: type = facet_access_type %T.loc25_16.2 [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)]
  364. // CHECK:STDOUT: %A.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc25_16.2, @A, @A(constants.%X) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)]
  365. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value %T.as_type.loc26_4.2, (%A.lookup_impl_witness) [symbolic = %A.facet (constants.%A.facet.11f)]
  366. // CHECK:STDOUT: %.loc26_4.3: type = fn_type_with_self_type constants.%F.type.13d, %A.facet [symbolic = %.loc26_4.3 (constants.%.ffa)]
  367. // CHECK:STDOUT: %impl.elem0.loc26_4.2: @CallGeneric.%.loc26_4.3 (%.ffa) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0)]
  368. // CHECK:STDOUT: %specific_impl_fn.loc26_4.2: <specific function> = specific_impl_function %impl.elem0.loc26_4.2, @F.1(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn)]
  369. // CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.as_type.loc26_4.2, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.e28)]
  370. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.500)]
  371. // CHECK:STDOUT:
  372. // CHECK:STDOUT: fn() {
  373. // CHECK:STDOUT: !entry:
  374. // CHECK:STDOUT: %T.ref: %A.type.91f = name_ref T, %T.loc25_16.1 [symbolic = %T.loc25_16.2 (constants.%T.9c2)]
  375. // CHECK:STDOUT: %.loc26_4.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6]
  376. // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc26_4.1 [concrete = constants.%assoc0.5f6]
  377. // CHECK:STDOUT: %T.as_type.loc26_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)]
  378. // CHECK:STDOUT: %.loc26_4.2: type = converted %T.ref, %T.as_type.loc26_4.1 [symbolic = %T.as_type.loc26_4.2 (constants.%T.as_type)]
  379. // CHECK:STDOUT: %impl.elem0.loc26_4.1: @CallGeneric.%.loc26_4.3 (%.ffa) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc26_4.2 (constants.%impl.elem0)]
  380. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z]
  381. // CHECK:STDOUT: %.loc26_11.1: %empty_struct_type = struct_literal ()
  382. // CHECK:STDOUT: %specific_impl_fn.loc26_4.1: <specific function> = specific_impl_function %impl.elem0.loc26_4.1, @F.1(constants.%X, constants.%A.facet.11f, constants.%Z) [symbolic = %specific_impl_fn.loc26_4.2 (constants.%specific_impl_fn)]
  383. // CHECK:STDOUT: %.loc26_12.1: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary_storage
  384. // CHECK:STDOUT: %.loc26_11.2: ref %Z = temporary_storage
  385. // CHECK:STDOUT: %.loc26_11.3: init %Z = class_init (), %.loc26_11.2 [concrete = constants.%Z.val]
  386. // CHECK:STDOUT: %.loc26_11.4: ref %Z = temporary %.loc26_11.2, %.loc26_11.3
  387. // CHECK:STDOUT: %.loc26_11.5: ref %Z = converted %.loc26_11.1, %.loc26_11.4
  388. // CHECK:STDOUT: %.loc26_11.6: %Z = bind_value %.loc26_11.5
  389. // CHECK:STDOUT: %.loc26_12.2: init @CallGeneric.%tuple.type (%tuple.type.e28) = call %specific_impl_fn.loc26_4.1(%.loc26_11.6) to %.loc26_12.1
  390. // CHECK:STDOUT: %.loc26_12.3: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary %.loc26_12.1, %.loc26_12.2
  391. // CHECK:STDOUT: return
  392. // CHECK:STDOUT: }
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT:
  395. // CHECK:STDOUT: fn @CallIndirect() {
  396. // CHECK:STDOUT: !entry:
  397. // CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric]
  398. // CHECK:STDOUT: %Y.ref: type = name_ref Y, file.%Y.decl [concrete = constants.%Y]
  399. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%Y, (constants.%A.impl_witness) [concrete = constants.%A.facet.552]
  400. // CHECK:STDOUT: %.loc30: %A.type.91f = converted %Y.ref, %A.facet [concrete = constants.%A.facet.552]
  401. // CHECK:STDOUT: %CallGeneric.specific_fn: <specific function> = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.552) [concrete = constants.%CallGeneric.specific_fn]
  402. // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn()
  403. // CHECK:STDOUT: return
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT:
  406. // CHECK:STDOUT: specific @A(constants.%T.8b3) {
  407. // CHECK:STDOUT: %T.loc5_13.2 => constants.%T.8b3
  408. // CHECK:STDOUT: }
  409. // CHECK:STDOUT:
  410. // CHECK:STDOUT: specific @F.1(constants.%T.8b3, constants.%Self.753, constants.%U.2cb) {
  411. // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.2cb
  412. // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.20f
  413. // CHECK:STDOUT: %T => constants.%T.8b3
  414. // CHECK:STDOUT: %A.type => constants.%A.type.75a
  415. // CHECK:STDOUT: %Self => constants.%Self.753
  416. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.e59
  417. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Self.as_type
  418. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.bd2
  419. // CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.44c
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: specific @A(constants.%X) {
  423. // CHECK:STDOUT: %T.loc5_13.2 => constants.%X
  424. // CHECK:STDOUT:
  425. // CHECK:STDOUT: !definition:
  426. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  427. // CHECK:STDOUT: %Self.2 => constants.%Self.1bb
  428. // CHECK:STDOUT: %F.type => constants.%F.type.13d
  429. // CHECK:STDOUT: %F => constants.%F.d83
  430. // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.296
  431. // CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.5f6
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT:
  434. // CHECK:STDOUT: specific @F.2(constants.%U.8b3) {
  435. // CHECK:STDOUT: %U.loc16_8.1 => constants.%U.8b3
  436. // CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.7dc
  437. // CHECK:STDOUT: %tuple.type.loc16 => constants.%tuple.type.765
  438. // CHECK:STDOUT: %pattern_type.loc16_24 => constants.%pattern_type.340
  439. // CHECK:STDOUT: }
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.552, constants.%U.8b3) {
  442. // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.8b3
  443. // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.7dc
  444. // CHECK:STDOUT: %T => constants.%X
  445. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  446. // CHECK:STDOUT: %Self => constants.%A.facet.552
  447. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  448. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Y
  449. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.765
  450. // CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.340
  451. // CHECK:STDOUT: }
  452. // CHECK:STDOUT:
  453. // CHECK:STDOUT: specific @F.2(constants.%Z) {
  454. // CHECK:STDOUT: %U.loc16_8.1 => constants.%Z
  455. // CHECK:STDOUT: %pattern_type.loc16_18 => constants.%pattern_type.8f9
  456. // CHECK:STDOUT: %tuple.type.loc16 => constants.%tuple.type.f6b
  457. // CHECK:STDOUT: %pattern_type.loc16_24 => constants.%pattern_type.ef1
  458. // CHECK:STDOUT:
  459. // CHECK:STDOUT: !definition:
  460. // CHECK:STDOUT: %require_complete.loc16_24 => constants.%complete_type.a64
  461. // CHECK:STDOUT: %require_complete.loc16_19 => constants.%complete_type.357
  462. // CHECK:STDOUT: %tuple.type.loc17 => constants.%tuple.type.9c8
  463. // CHECK:STDOUT: }
  464. // CHECK:STDOUT:
  465. // CHECK:STDOUT: specific @CallGeneric(constants.%T.9c2) {
  466. // CHECK:STDOUT: %T.loc25_16.2 => constants.%T.9c2
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.11f, constants.%Z) {
  470. // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z
  471. // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.8f9
  472. // CHECK:STDOUT: %T => constants.%X
  473. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  474. // CHECK:STDOUT: %Self => constants.%A.facet.11f
  475. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  476. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%T.as_type
  477. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.e28
  478. // CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.f25
  479. // CHECK:STDOUT: }
  480. // CHECK:STDOUT:
  481. // CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.552) {
  482. // CHECK:STDOUT: %T.loc25_16.2 => constants.%A.facet.552
  483. // CHECK:STDOUT:
  484. // CHECK:STDOUT: !definition:
  485. // CHECK:STDOUT: %T.as_type.loc26_4.2 => constants.%Y
  486. // CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness
  487. // CHECK:STDOUT: %A.facet => constants.%A.facet.552
  488. // CHECK:STDOUT: %.loc26_4.3 => constants.%.a60
  489. // CHECK:STDOUT: %impl.elem0.loc26_4.2 => constants.%F.ce9
  490. // CHECK:STDOUT: %specific_impl_fn.loc26_4.2 => constants.%F.specific_fn
  491. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.f6b
  492. // CHECK:STDOUT: %require_complete => constants.%complete_type.a64
  493. // CHECK:STDOUT: }
  494. // CHECK:STDOUT:
  495. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.552, constants.%Z) {
  496. // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z
  497. // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.8f9
  498. // CHECK:STDOUT: %T => constants.%X
  499. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  500. // CHECK:STDOUT: %Self => constants.%A.facet.552
  501. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  502. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Y
  503. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.f6b
  504. // CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.ef1
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT:
  507. // CHECK:STDOUT: --- generic_method_more_params.carbon
  508. // CHECK:STDOUT:
  509. // CHECK:STDOUT: constants {
  510. // CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
  511. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  512. // CHECK:STDOUT: %A.type.495: type = generic_interface_type @A [concrete]
  513. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  514. // CHECK:STDOUT: %A.generic: %A.type.495 = struct_value () [concrete]
  515. // CHECK:STDOUT: %A.type.75a: type = facet_type <@A, @A(%T.8b3)> [symbolic]
  516. // CHECK:STDOUT: %Self.753: %A.type.75a = bind_symbolic_name Self, 1 [symbolic]
  517. // CHECK:STDOUT: %U.2cb: type = bind_symbolic_name U, 2 [symbolic]
  518. // CHECK:STDOUT: %pattern_type.20f: type = pattern_type %U.2cb [symbolic]
  519. // CHECK:STDOUT: %tuple.type.e59: type = tuple_type (type, %A.type.75a, type) [symbolic]
  520. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.753 [symbolic]
  521. // CHECK:STDOUT: %tuple.type.bd2: type = tuple_type (%T.8b3, %Self.as_type, %U.2cb) [symbolic]
  522. // CHECK:STDOUT: %pattern_type.44c: type = pattern_type %tuple.type.bd2 [symbolic]
  523. // CHECK:STDOUT: %F.type.17a: type = fn_type @F.1, @A(%T.8b3) [symbolic]
  524. // CHECK:STDOUT: %F.0d8: %F.type.17a = struct_value () [symbolic]
  525. // CHECK:STDOUT: %A.assoc_type.ed3: type = assoc_entity_type @A, @A(%T.8b3) [symbolic]
  526. // CHECK:STDOUT: %assoc0.fcb: %A.assoc_type.ed3 = assoc_entity element0, @A.%F.decl [symbolic]
  527. // CHECK:STDOUT: %X: type = class_type @X [concrete]
  528. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  529. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  530. // CHECK:STDOUT: %Y1: type = class_type @Y1 [concrete]
  531. // CHECK:STDOUT: %Y2: type = class_type @Y2 [concrete]
  532. // CHECK:STDOUT: %Z: type = class_type @Z [concrete]
  533. // CHECK:STDOUT: %V1: type = bind_symbolic_name V1, 0 [symbolic]
  534. // CHECK:STDOUT: %V2: type = bind_symbolic_name V2, 1 [symbolic]
  535. // CHECK:STDOUT: %W: type = bind_symbolic_name W, 2 [symbolic]
  536. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
  537. // CHECK:STDOUT: %tuple.type.30b: type = tuple_type (%V1, %V2) [symbolic]
  538. // CHECK:STDOUT: %A.type.f21: type = facet_type <@A, @A(%W)> [symbolic]
  539. // CHECK:STDOUT: %Self.4fe: %A.type.f21 = bind_symbolic_name Self, 1 [symbolic]
  540. // CHECK:STDOUT: %F.type.904: type = fn_type @F.1, @A(%W) [symbolic]
  541. // CHECK:STDOUT: %F.1ee: %F.type.904 = struct_value () [symbolic]
  542. // CHECK:STDOUT: %A.assoc_type.b05: type = assoc_entity_type @A, @A(%W) [symbolic]
  543. // CHECK:STDOUT: %assoc0.c82: %A.assoc_type.b05 = assoc_entity element0, @A.%F.decl [symbolic]
  544. // CHECK:STDOUT: %require_complete.796: <witness> = require_complete_type %A.type.f21 [symbolic]
  545. // CHECK:STDOUT: %A.impl_witness.f15: <witness> = impl_witness file.%A.impl_witness_table, @impl(%V1, %V2, %W) [symbolic]
  546. // CHECK:STDOUT: %U.753: type = bind_symbolic_name U, 3 [symbolic]
  547. // CHECK:STDOUT: %pattern_type.549: type = pattern_type %U.753 [symbolic]
  548. // CHECK:STDOUT: %tuple.type.11f: type = tuple_type (type, %tuple.type.24b, type) [concrete]
  549. // CHECK:STDOUT: %tuple.type.8ae: type = tuple_type (%W, %tuple.type.30b, %U.753) [symbolic]
  550. // CHECK:STDOUT: %pattern_type.d4a: type = pattern_type %tuple.type.8ae [symbolic]
  551. // CHECK:STDOUT: %F.type.b3e: type = fn_type @F.2, @impl(%V1, %V2, %W) [symbolic]
  552. // CHECK:STDOUT: %F.d79: %F.type.b3e = struct_value () [symbolic]
  553. // CHECK:STDOUT: %A.facet.461: %A.type.f21 = facet_value %tuple.type.30b, (%A.impl_witness.f15) [symbolic]
  554. // CHECK:STDOUT: %tuple.type.136: type = tuple_type (type, %A.type.f21, type) [symbolic]
  555. // CHECK:STDOUT: %require_complete.d4d: <witness> = require_complete_type %tuple.type.8ae [symbolic]
  556. // CHECK:STDOUT: %require_complete.ed4: <witness> = require_complete_type %U.753 [symbolic]
  557. // CHECK:STDOUT: %F.specific_fn.7d9: <specific function> = specific_function %F.d79, @F.2(%V1, %V2, %W, %U.753) [symbolic]
  558. // CHECK:STDOUT: %Call.type: type = fn_type @Call [concrete]
  559. // CHECK:STDOUT: %Call: %Call.type = struct_value () [concrete]
  560. // CHECK:STDOUT: %tuple.type.a46: type = tuple_type (%Y1, %Y2) [concrete]
  561. // CHECK:STDOUT: %A.type.91f: type = facet_type <@A, @A(%X)> [concrete]
  562. // CHECK:STDOUT: %Self.1bb: %A.type.91f = bind_symbolic_name Self, 1 [symbolic]
  563. // CHECK:STDOUT: %F.type.13d: type = fn_type @F.1, @A(%X) [concrete]
  564. // CHECK:STDOUT: %F.d83: %F.type.13d = struct_value () [concrete]
  565. // CHECK:STDOUT: %A.assoc_type.296: type = assoc_entity_type @A, @A(%X) [concrete]
  566. // CHECK:STDOUT: %assoc0.5f6: %A.assoc_type.296 = assoc_entity element0, @A.%F.decl [concrete]
  567. // CHECK:STDOUT: %complete_type.d76: <witness> = complete_type_witness %A.type.91f [concrete]
  568. // CHECK:STDOUT: %A.impl_witness.8ac: <witness> = impl_witness file.%A.impl_witness_table, @impl(%Y1, %Y2, %X) [concrete]
  569. // CHECK:STDOUT: %F.type.bf7: type = fn_type @F.2, @impl(%Y1, %Y2, %X) [concrete]
  570. // CHECK:STDOUT: %F.93b: %F.type.bf7 = struct_value () [concrete]
  571. // CHECK:STDOUT: %A.facet.414: %A.type.91f = facet_value %tuple.type.a46, (%A.impl_witness.8ac) [concrete]
  572. // CHECK:STDOUT: %.406: type = fn_type_with_self_type %F.type.13d, %A.facet.414 [concrete]
  573. // CHECK:STDOUT: %pattern_type.8f9: type = pattern_type %Z [concrete]
  574. // CHECK:STDOUT: %tuple.type.415: type = tuple_type (%X, %tuple.type.a46, %Z) [concrete]
  575. // CHECK:STDOUT: %pattern_type.0b2: type = pattern_type %tuple.type.415 [concrete]
  576. // CHECK:STDOUT: %F.specific_fn.79b: <specific function> = specific_function %F.93b, @F.2(%Y1, %Y2, %X, %Z) [concrete]
  577. // CHECK:STDOUT: %Z.val: %Z = struct_value () [concrete]
  578. // CHECK:STDOUT: %T.9c2: %A.type.91f = bind_symbolic_name T, 0 [symbolic]
  579. // CHECK:STDOUT: %pattern_type.817: type = pattern_type %A.type.91f [concrete]
  580. // CHECK:STDOUT: %CallGeneric.type: type = fn_type @CallGeneric [concrete]
  581. // CHECK:STDOUT: %CallGeneric: %CallGeneric.type = struct_value () [concrete]
  582. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T.9c2 [symbolic]
  583. // CHECK:STDOUT: %A.lookup_impl_witness: <witness> = lookup_impl_witness %T.9c2, @A, @A(%X) [symbolic]
  584. // CHECK:STDOUT: %A.facet.11f: %A.type.91f = facet_value %T.as_type, (%A.lookup_impl_witness) [symbolic]
  585. // CHECK:STDOUT: %.ffa: type = fn_type_with_self_type %F.type.13d, %A.facet.11f [symbolic]
  586. // CHECK:STDOUT: %impl.elem0: %.ffa = impl_witness_access %A.lookup_impl_witness, element0 [symbolic]
  587. // CHECK:STDOUT: %tuple.type.a0c: type = tuple_type (type, %A.type.91f, type) [concrete]
  588. // CHECK:STDOUT: %tuple.type.e28: type = tuple_type (%X, %T.as_type, %Z) [symbolic]
  589. // CHECK:STDOUT: %pattern_type.f25: type = pattern_type %tuple.type.e28 [symbolic]
  590. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @F.1(%X, %A.facet.11f, %Z) [symbolic]
  591. // CHECK:STDOUT: %require_complete.500: <witness> = require_complete_type %tuple.type.e28 [symbolic]
  592. // CHECK:STDOUT: %CallIndirect.type: type = fn_type @CallIndirect [concrete]
  593. // CHECK:STDOUT: %CallIndirect: %CallIndirect.type = struct_value () [concrete]
  594. // CHECK:STDOUT: %CallGeneric.specific_fn: <specific function> = specific_function %CallGeneric, @CallGeneric(%A.facet.414) [concrete]
  595. // CHECK:STDOUT: %complete_type.aa8: <witness> = complete_type_witness %tuple.type.415 [concrete]
  596. // CHECK:STDOUT: }
  597. // CHECK:STDOUT:
  598. // CHECK:STDOUT: imports {
  599. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  600. // CHECK:STDOUT: import Core//prelude
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT:
  604. // CHECK:STDOUT: file {
  605. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  606. // CHECK:STDOUT: .Core = imports.%Core
  607. // CHECK:STDOUT: .A = %A.decl
  608. // CHECK:STDOUT: .X = %X.decl
  609. // CHECK:STDOUT: .Y1 = %Y1.decl
  610. // CHECK:STDOUT: .Y2 = %Y2.decl
  611. // CHECK:STDOUT: .Z = %Z.decl
  612. // CHECK:STDOUT: .Call = %Call.decl
  613. // CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
  614. // CHECK:STDOUT: .CallIndirect = %CallIndirect.decl
  615. // CHECK:STDOUT: }
  616. // CHECK:STDOUT: %Core.import = import Core
  617. // CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [concrete = constants.%A.generic] {
  618. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  619. // CHECK:STDOUT: } {
  620. // CHECK:STDOUT: %T.loc5_13.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)]
  621. // CHECK:STDOUT: }
  622. // CHECK:STDOUT: %X.decl: type = class_decl @X [concrete = constants.%X] {} {}
  623. // CHECK:STDOUT: %Y1.decl: type = class_decl @Y1 [concrete = constants.%Y1] {} {}
  624. // CHECK:STDOUT: %Y2.decl: type = class_decl @Y2 [concrete = constants.%Y2] {} {}
  625. // CHECK:STDOUT: %Z.decl: type = class_decl @Z [concrete = constants.%Z] {} {}
  626. // CHECK:STDOUT: impl_decl @impl [concrete] {
  627. // CHECK:STDOUT: %V1.patt: %pattern_type.98f = symbolic_binding_pattern V1, 0 [concrete]
  628. // CHECK:STDOUT: %V2.patt: %pattern_type.98f = symbolic_binding_pattern V2, 1 [concrete]
  629. // CHECK:STDOUT: %W.patt: %pattern_type.98f = symbolic_binding_pattern W, 2 [concrete]
  630. // CHECK:STDOUT: } {
  631. // CHECK:STDOUT: %V1.ref: type = name_ref V1, %V1.loc14_14.1 [symbolic = %V1.loc14_14.2 (constants.%V1)]
  632. // CHECK:STDOUT: %V2.ref: type = name_ref V2, %V2.loc14_25.1 [symbolic = %V2.loc14_25.2 (constants.%V2)]
  633. // CHECK:STDOUT: %.loc14_53.1: %tuple.type.24b = tuple_literal (%V1.ref, %V2.ref)
  634. // CHECK:STDOUT: %.loc14_53.2: type = converted %.loc14_53.1, constants.%tuple.type.30b [symbolic = %tuple.type (constants.%tuple.type.30b)]
  635. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  636. // CHECK:STDOUT: %W.ref: type = name_ref W, %W.loc14_36.1 [symbolic = %W.loc14_36.2 (constants.%W)]
  637. // CHECK:STDOUT: %A.type.loc14_61.1: type = facet_type <@A, @A(constants.%W)> [symbolic = %A.type.loc14_61.2 (constants.%A.type.f21)]
  638. // CHECK:STDOUT: %V1.loc14_14.1: type = bind_symbolic_name V1, 0 [symbolic = %V1.loc14_14.2 (constants.%V1)]
  639. // CHECK:STDOUT: %V2.loc14_25.1: type = bind_symbolic_name V2, 1 [symbolic = %V2.loc14_25.2 (constants.%V2)]
  640. // CHECK:STDOUT: %W.loc14_36.1: type = bind_symbolic_name W, 2 [symbolic = %W.loc14_36.2 (constants.%W)]
  641. // CHECK:STDOUT: }
  642. // CHECK:STDOUT: %A.impl_witness_table = impl_witness_table (@impl.%F.decl), @impl [concrete]
  643. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness %A.impl_witness_table, @impl(constants.%V1, constants.%V2, constants.%W) [symbolic = @impl.%A.impl_witness (constants.%A.impl_witness.f15)]
  644. // CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {}
  645. // CHECK:STDOUT: %CallGeneric.decl: %CallGeneric.type = fn_decl @CallGeneric [concrete = constants.%CallGeneric] {
  646. // CHECK:STDOUT: %T.patt: %pattern_type.817 = symbolic_binding_pattern T, 0 [concrete]
  647. // CHECK:STDOUT: } {
  648. // CHECK:STDOUT: %.loc27: type = splice_block %A.type [concrete = constants.%A.type.91f] {
  649. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  650. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  651. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  652. // CHECK:STDOUT: }
  653. // CHECK:STDOUT: %T.loc27_16.1: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.2 (constants.%T.9c2)]
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT: %CallIndirect.decl: %CallIndirect.type = fn_decl @CallIndirect [concrete = constants.%CallIndirect] {} {}
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT:
  658. // CHECK:STDOUT: generic interface @A(%T.loc5_13.1: type) {
  659. // CHECK:STDOUT: %T.loc5_13.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc5_13.2 (constants.%T.8b3)]
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: !definition:
  662. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T.loc5_13.2)> [symbolic = %A.type (constants.%A.type.75a)]
  663. // CHECK:STDOUT: %Self.2: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.753)]
  664. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @A(%T.loc5_13.2) [symbolic = %F.type (constants.%F.type.17a)]
  665. // CHECK:STDOUT: %F: @A.%F.type (%F.type.17a) = struct_value () [symbolic = %F (constants.%F.0d8)]
  666. // CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A, @A(%T.loc5_13.2) [symbolic = %A.assoc_type (constants.%A.assoc_type.ed3)]
  667. // CHECK:STDOUT: %assoc0.loc6_39.2: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)]
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: interface {
  670. // CHECK:STDOUT: %Self.1: @A.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.753)]
  671. // CHECK:STDOUT: %F.decl: @A.%F.type (%F.type.17a) = fn_decl @F.1 [symbolic = @A.%F (constants.%F.0d8)] {
  672. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 2 [concrete]
  673. // CHECK:STDOUT: %u.patt: @F.1.%pattern_type.loc6_18 (%pattern_type.20f) = binding_pattern u [concrete]
  674. // CHECK:STDOUT: %u.param_patt: @F.1.%pattern_type.loc6_18 (%pattern_type.20f) = value_param_pattern %u.patt, call_param0 [concrete]
  675. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type.loc6_24 (%pattern_type.44c) = return_slot_pattern [concrete]
  676. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type.loc6_24 (%pattern_type.44c) = out_param_pattern %return.patt, call_param1 [concrete]
  677. // CHECK:STDOUT: } {
  678. // CHECK:STDOUT: %T.ref: type = name_ref T, @A.%T.loc5_13.1 [symbolic = %T (constants.%T.8b3)]
  679. // CHECK:STDOUT: %.loc6_31: @F.1.%A.type (%A.type.75a) = specific_constant @A.%Self.1, @A(constants.%T.8b3) [symbolic = %Self (constants.%Self.753)]
  680. // CHECK:STDOUT: %Self.ref: @F.1.%A.type (%A.type.75a) = name_ref Self, %.loc6_31 [symbolic = %Self (constants.%Self.753)]
  681. // CHECK:STDOUT: %U.ref.loc6_37: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  682. // CHECK:STDOUT: %.loc6_38.1: @F.1.%tuple.type.loc6_38.1 (%tuple.type.e59) = tuple_literal (%T.ref, %Self.ref, %U.ref.loc6_37)
  683. // CHECK:STDOUT: %Self.as_type.loc6_38.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  684. // CHECK:STDOUT: %.loc6_38.2: type = converted %Self.ref, %Self.as_type.loc6_38.2 [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  685. // CHECK:STDOUT: %.loc6_38.3: type = converted %.loc6_38.1, constants.%tuple.type.bd2 [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)]
  686. // CHECK:STDOUT: %U.loc6_8.2: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  687. // CHECK:STDOUT: %u.param: @F.1.%U.loc6_8.1 (%U.2cb) = value_param call_param0
  688. // CHECK:STDOUT: %U.ref.loc6_21: type = name_ref U, %U.loc6_8.2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  689. // CHECK:STDOUT: %u: @F.1.%U.loc6_8.1 (%U.2cb) = bind_name u, %u.param
  690. // CHECK:STDOUT: %return.param: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = out_param call_param1
  691. // CHECK:STDOUT: %return: ref @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2) = return_slot %return.param
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT: %assoc0.loc6_39.1: @A.%A.assoc_type (%A.assoc_type.ed3) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc6_39.2 (constants.%assoc0.fcb)]
  694. // CHECK:STDOUT:
  695. // CHECK:STDOUT: !members:
  696. // CHECK:STDOUT: .Self = %Self.1
  697. // CHECK:STDOUT: .T = <poisoned>
  698. // CHECK:STDOUT: .F = %assoc0.loc6_39.1
  699. // CHECK:STDOUT: witness = (%F.decl)
  700. // CHECK:STDOUT: }
  701. // CHECK:STDOUT: }
  702. // CHECK:STDOUT:
  703. // CHECK:STDOUT: generic impl @impl(%V1.loc14_14.1: type, %V2.loc14_25.1: type, %W.loc14_36.1: type) {
  704. // CHECK:STDOUT: %V1.loc14_14.2: type = bind_symbolic_name V1, 0 [symbolic = %V1.loc14_14.2 (constants.%V1)]
  705. // CHECK:STDOUT: %V2.loc14_25.2: type = bind_symbolic_name V2, 1 [symbolic = %V2.loc14_25.2 (constants.%V2)]
  706. // CHECK:STDOUT: %W.loc14_36.2: type = bind_symbolic_name W, 2 [symbolic = %W.loc14_36.2 (constants.%W)]
  707. // CHECK:STDOUT: %tuple.type: type = tuple_type (%V1.loc14_14.2, %V2.loc14_25.2) [symbolic = %tuple.type (constants.%tuple.type.30b)]
  708. // CHECK:STDOUT: %A.type.loc14_61.2: type = facet_type <@A, @A(%W.loc14_36.2)> [symbolic = %A.type.loc14_61.2 (constants.%A.type.f21)]
  709. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %A.type.loc14_61.2 [symbolic = %require_complete (constants.%require_complete.796)]
  710. // CHECK:STDOUT: %A.impl_witness: <witness> = impl_witness file.%A.impl_witness_table, @impl(%V1.loc14_14.2, %V2.loc14_25.2, %W.loc14_36.2) [symbolic = %A.impl_witness (constants.%A.impl_witness.f15)]
  711. // CHECK:STDOUT:
  712. // CHECK:STDOUT: !definition:
  713. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%V1.loc14_14.2, %V2.loc14_25.2, %W.loc14_36.2) [symbolic = %F.type (constants.%F.type.b3e)]
  714. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.b3e) = struct_value () [symbolic = %F (constants.%F.d79)]
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: impl: %.loc14_53.2 as %A.type.loc14_61.1 {
  717. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.b3e) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.d79)] {
  718. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 3 [concrete]
  719. // CHECK:STDOUT: %u.patt: @F.2.%pattern_type.loc17_18 (%pattern_type.549) = binding_pattern u [concrete]
  720. // CHECK:STDOUT: %u.param_patt: @F.2.%pattern_type.loc17_18 (%pattern_type.549) = value_param_pattern %u.patt, call_param0 [concrete]
  721. // CHECK:STDOUT: %return.patt: @F.2.%pattern_type.loc17_24 (%pattern_type.d4a) = return_slot_pattern [concrete]
  722. // CHECK:STDOUT: %return.param_patt: @F.2.%pattern_type.loc17_24 (%pattern_type.d4a) = out_param_pattern %return.patt, call_param1 [concrete]
  723. // CHECK:STDOUT: } {
  724. // CHECK:STDOUT: %W.ref: type = name_ref W, @impl.%W.loc14_36.1 [symbolic = %W (constants.%W)]
  725. // CHECK:STDOUT: %V1.ref: type = name_ref V1, @impl.%V1.loc14_14.1 [symbolic = %V1 (constants.%V1)]
  726. // CHECK:STDOUT: %V2.ref: type = name_ref V2, @impl.%V2.loc14_25.1 [symbolic = %V2 (constants.%V2)]
  727. // CHECK:STDOUT: %.loc17_38: %tuple.type.24b = tuple_literal (%V1.ref, %V2.ref)
  728. // CHECK:STDOUT: %U.ref.loc17_41: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  729. // CHECK:STDOUT: %.loc17_42.1: %tuple.type.11f = tuple_literal (%W.ref, %.loc17_38, %U.ref.loc17_41)
  730. // CHECK:STDOUT: %.loc17_42.2: type = converted %.loc17_38, constants.%tuple.type.30b [symbolic = %tuple.type.loc17_42.1 (constants.%tuple.type.30b)]
  731. // CHECK:STDOUT: %.loc17_42.3: type = converted %.loc17_42.1, constants.%tuple.type.8ae [symbolic = %tuple.type.loc17_42.2 (constants.%tuple.type.8ae)]
  732. // CHECK:STDOUT: %U.loc17_8.2: type = bind_symbolic_name U, 3 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  733. // CHECK:STDOUT: %u.param: @F.2.%U.loc17_8.1 (%U.753) = value_param call_param0
  734. // CHECK:STDOUT: %U.ref.loc17_21: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  735. // CHECK:STDOUT: %u: @F.2.%U.loc17_8.1 (%U.753) = bind_name u, %u.param
  736. // CHECK:STDOUT: %return.param: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = out_param call_param1
  737. // CHECK:STDOUT: %return: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = return_slot %return.param
  738. // CHECK:STDOUT: }
  739. // CHECK:STDOUT:
  740. // CHECK:STDOUT: !members:
  741. // CHECK:STDOUT: .W = <poisoned>
  742. // CHECK:STDOUT: .V1 = <poisoned>
  743. // CHECK:STDOUT: .V2 = <poisoned>
  744. // CHECK:STDOUT: .F = %F.decl
  745. // CHECK:STDOUT: witness = file.%A.impl_witness
  746. // CHECK:STDOUT: }
  747. // CHECK:STDOUT: }
  748. // CHECK:STDOUT:
  749. // CHECK:STDOUT: class @X {
  750. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  751. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  752. // CHECK:STDOUT: complete_type_witness = %complete_type
  753. // CHECK:STDOUT:
  754. // CHECK:STDOUT: !members:
  755. // CHECK:STDOUT: .Self = constants.%X
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT:
  758. // CHECK:STDOUT: class @Y1 {
  759. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  760. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  761. // CHECK:STDOUT: complete_type_witness = %complete_type
  762. // CHECK:STDOUT:
  763. // CHECK:STDOUT: !members:
  764. // CHECK:STDOUT: .Self = constants.%Y1
  765. // CHECK:STDOUT: }
  766. // CHECK:STDOUT:
  767. // CHECK:STDOUT: class @Y2 {
  768. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  769. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  770. // CHECK:STDOUT: complete_type_witness = %complete_type
  771. // CHECK:STDOUT:
  772. // CHECK:STDOUT: !members:
  773. // CHECK:STDOUT: .Self = constants.%Y2
  774. // CHECK:STDOUT: }
  775. // CHECK:STDOUT:
  776. // CHECK:STDOUT: class @Z {
  777. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  778. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  779. // CHECK:STDOUT: complete_type_witness = %complete_type
  780. // CHECK:STDOUT:
  781. // CHECK:STDOUT: !members:
  782. // CHECK:STDOUT: .Self = constants.%Z
  783. // CHECK:STDOUT: }
  784. // CHECK:STDOUT:
  785. // CHECK:STDOUT: generic fn @F.1(@A.%T.loc5_13.1: type, @A.%Self.1: @A.%A.type (%A.type.75a), %U.loc6_8.2: type) {
  786. // CHECK:STDOUT: %U.loc6_8.1: type = bind_symbolic_name U, 2 [symbolic = %U.loc6_8.1 (constants.%U.2cb)]
  787. // CHECK:STDOUT: %pattern_type.loc6_18: type = pattern_type %U.loc6_8.1 [symbolic = %pattern_type.loc6_18 (constants.%pattern_type.20f)]
  788. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T.8b3)]
  789. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(%T)> [symbolic = %A.type (constants.%A.type.75a)]
  790. // CHECK:STDOUT: %Self: @F.1.%A.type (%A.type.75a) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.753)]
  791. // CHECK:STDOUT: %tuple.type.loc6_38.1: type = tuple_type (type, %A.type, type) [symbolic = %tuple.type.loc6_38.1 (constants.%tuple.type.e59)]
  792. // CHECK:STDOUT: %Self.as_type.loc6_38.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc6_38.1 (constants.%Self.as_type)]
  793. // CHECK:STDOUT: %tuple.type.loc6_38.2: type = tuple_type (%T, %Self.as_type.loc6_38.1, %U.loc6_8.1) [symbolic = %tuple.type.loc6_38.2 (constants.%tuple.type.bd2)]
  794. // CHECK:STDOUT: %pattern_type.loc6_24: type = pattern_type %tuple.type.loc6_38.2 [symbolic = %pattern_type.loc6_24 (constants.%pattern_type.44c)]
  795. // CHECK:STDOUT:
  796. // CHECK:STDOUT: fn(%u.param: @F.1.%U.loc6_8.1 (%U.2cb)) -> @F.1.%tuple.type.loc6_38.2 (%tuple.type.bd2);
  797. // CHECK:STDOUT: }
  798. // CHECK:STDOUT:
  799. // CHECK:STDOUT: generic fn @F.2(@impl.%V1.loc14_14.1: type, @impl.%V2.loc14_25.1: type, @impl.%W.loc14_36.1: type, %U.loc17_8.2: type) {
  800. // CHECK:STDOUT: %U.loc17_8.1: type = bind_symbolic_name U, 3 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  801. // CHECK:STDOUT: %pattern_type.loc17_18: type = pattern_type %U.loc17_8.1 [symbolic = %pattern_type.loc17_18 (constants.%pattern_type.549)]
  802. // CHECK:STDOUT: %W: type = bind_symbolic_name W, 2 [symbolic = %W (constants.%W)]
  803. // CHECK:STDOUT: %V1: type = bind_symbolic_name V1, 0 [symbolic = %V1 (constants.%V1)]
  804. // CHECK:STDOUT: %V2: type = bind_symbolic_name V2, 1 [symbolic = %V2 (constants.%V2)]
  805. // CHECK:STDOUT: %tuple.type.loc17_42.1: type = tuple_type (%V1, %V2) [symbolic = %tuple.type.loc17_42.1 (constants.%tuple.type.30b)]
  806. // CHECK:STDOUT: %tuple.type.loc17_42.2: type = tuple_type (%W, %tuple.type.loc17_42.1, %U.loc17_8.1) [symbolic = %tuple.type.loc17_42.2 (constants.%tuple.type.8ae)]
  807. // CHECK:STDOUT: %pattern_type.loc17_24: type = pattern_type %tuple.type.loc17_42.2 [symbolic = %pattern_type.loc17_24 (constants.%pattern_type.d4a)]
  808. // CHECK:STDOUT:
  809. // CHECK:STDOUT: !definition:
  810. // CHECK:STDOUT: %require_complete.loc17_24: <witness> = require_complete_type %tuple.type.loc17_42.2 [symbolic = %require_complete.loc17_24 (constants.%require_complete.d4d)]
  811. // CHECK:STDOUT: %require_complete.loc17_19: <witness> = require_complete_type %U.loc17_8.1 [symbolic = %require_complete.loc17_19 (constants.%require_complete.ed4)]
  812. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%V1, %V2, %W) [symbolic = %F.type (constants.%F.type.b3e)]
  813. // CHECK:STDOUT: %F: @F.2.%F.type (%F.type.b3e) = struct_value () [symbolic = %F (constants.%F.d79)]
  814. // CHECK:STDOUT: %F.specific_fn.loc18_12.2: <specific function> = specific_function %F, @F.2(%V1, %V2, %W, %U.loc17_8.1) [symbolic = %F.specific_fn.loc18_12.2 (constants.%F.specific_fn.7d9)]
  815. // CHECK:STDOUT:
  816. // CHECK:STDOUT: fn(%u.param: @F.2.%U.loc17_8.1 (%U.753)) -> %return.param: @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) {
  817. // CHECK:STDOUT: !entry:
  818. // CHECK:STDOUT: %.loc18: @F.2.%F.type (%F.type.b3e) = specific_constant @impl.%F.decl, @impl(constants.%V1, constants.%V2, constants.%W) [symbolic = %F (constants.%F.d79)]
  819. // CHECK:STDOUT: %F.ref: @F.2.%F.type (%F.type.b3e) = name_ref F, %.loc18 [symbolic = %F (constants.%F.d79)]
  820. // CHECK:STDOUT: %U.ref.loc18: type = name_ref U, %U.loc17_8.2 [symbolic = %U.loc17_8.1 (constants.%U.753)]
  821. // CHECK:STDOUT: %u.ref: @F.2.%U.loc17_8.1 (%U.753) = name_ref u, %u
  822. // CHECK:STDOUT: %F.specific_fn.loc18_12.1: <specific function> = specific_function %F.ref, @F.2(constants.%V1, constants.%V2, constants.%W, constants.%U.753) [symbolic = %F.specific_fn.loc18_12.2 (constants.%F.specific_fn.7d9)]
  823. // CHECK:STDOUT: %.loc17_24: ref @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = splice_block %return {}
  824. // CHECK:STDOUT: %F.call: init @F.2.%tuple.type.loc17_42.2 (%tuple.type.8ae) = call %F.specific_fn.loc18_12.1(%u.ref) to %.loc17_24
  825. // CHECK:STDOUT: return %F.call to %return
  826. // CHECK:STDOUT: }
  827. // CHECK:STDOUT: }
  828. // CHECK:STDOUT:
  829. // CHECK:STDOUT: fn @Call() {
  830. // CHECK:STDOUT: !entry:
  831. // CHECK:STDOUT: %Y1.ref: type = name_ref Y1, file.%Y1.decl [concrete = constants.%Y1]
  832. // CHECK:STDOUT: %Y2.ref: type = name_ref Y2, file.%Y2.decl [concrete = constants.%Y2]
  833. // CHECK:STDOUT: %.loc24_12: %tuple.type.24b = tuple_literal (%Y1.ref, %Y2.ref)
  834. // CHECK:STDOUT: %.loc24_14: type = converted %.loc24_12, constants.%tuple.type.a46 [concrete = constants.%tuple.type.a46]
  835. // CHECK:STDOUT: %A.ref: %A.type.495 = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  836. // CHECK:STDOUT: %X.ref: type = name_ref X, file.%X.decl [concrete = constants.%X]
  837. // CHECK:STDOUT: %A.type: type = facet_type <@A, @A(constants.%X)> [concrete = constants.%A.type.91f]
  838. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%tuple.type.a46, (constants.%A.impl_witness.8ac) [concrete = constants.%A.facet.414]
  839. // CHECK:STDOUT: %.loc24_23: %A.type.91f = converted %.loc24_14, %A.facet [concrete = constants.%A.facet.414]
  840. // CHECK:STDOUT: %.loc24_31.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6]
  841. // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc24_31.1 [concrete = constants.%assoc0.5f6]
  842. // CHECK:STDOUT: %as_type: type = facet_access_type %.loc24_23 [concrete = constants.%tuple.type.a46]
  843. // CHECK:STDOUT: %.loc24_31.2: type = converted %.loc24_23, %as_type [concrete = constants.%tuple.type.a46]
  844. // CHECK:STDOUT: %impl.elem0: %.406 = impl_witness_access constants.%A.impl_witness.8ac, element0 [concrete = constants.%F.93b]
  845. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z]
  846. // CHECK:STDOUT: %.loc24_38.1: %empty_struct_type = struct_literal ()
  847. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%Y1, constants.%Y2, constants.%X, constants.%Z) [concrete = constants.%F.specific_fn.79b]
  848. // CHECK:STDOUT: %.loc24_39.1: ref %tuple.type.415 = temporary_storage
  849. // CHECK:STDOUT: %.loc24_38.2: ref %Z = temporary_storage
  850. // CHECK:STDOUT: %.loc24_38.3: init %Z = class_init (), %.loc24_38.2 [concrete = constants.%Z.val]
  851. // CHECK:STDOUT: %.loc24_38.4: ref %Z = temporary %.loc24_38.2, %.loc24_38.3
  852. // CHECK:STDOUT: %.loc24_38.5: ref %Z = converted %.loc24_38.1, %.loc24_38.4
  853. // CHECK:STDOUT: %.loc24_38.6: %Z = bind_value %.loc24_38.5
  854. // CHECK:STDOUT: %F.call: init %tuple.type.415 = call %specific_fn(%.loc24_38.6) to %.loc24_39.1
  855. // CHECK:STDOUT: %.loc24_39.2: ref %tuple.type.415 = temporary %.loc24_39.1, %F.call
  856. // CHECK:STDOUT: return
  857. // CHECK:STDOUT: }
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: generic fn @CallGeneric(%T.loc27_16.1: %A.type.91f) {
  860. // CHECK:STDOUT: %T.loc27_16.2: %A.type.91f = bind_symbolic_name T, 0 [symbolic = %T.loc27_16.2 (constants.%T.9c2)]
  861. // CHECK:STDOUT:
  862. // CHECK:STDOUT: !definition:
  863. // CHECK:STDOUT: %T.as_type.loc28_4.2: type = facet_access_type %T.loc27_16.2 [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)]
  864. // CHECK:STDOUT: %A.lookup_impl_witness: <witness> = lookup_impl_witness %T.loc27_16.2, @A, @A(constants.%X) [symbolic = %A.lookup_impl_witness (constants.%A.lookup_impl_witness)]
  865. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value %T.as_type.loc28_4.2, (%A.lookup_impl_witness) [symbolic = %A.facet (constants.%A.facet.11f)]
  866. // CHECK:STDOUT: %.loc28_4.3: type = fn_type_with_self_type constants.%F.type.13d, %A.facet [symbolic = %.loc28_4.3 (constants.%.ffa)]
  867. // CHECK:STDOUT: %impl.elem0.loc28_4.2: @CallGeneric.%.loc28_4.3 (%.ffa) = impl_witness_access %A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)]
  868. // CHECK:STDOUT: %specific_impl_fn.loc28_4.2: <specific function> = specific_impl_function %impl.elem0.loc28_4.2, @F.1(constants.%X, %A.facet, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)]
  869. // CHECK:STDOUT: %tuple.type: type = tuple_type (constants.%X, %T.as_type.loc28_4.2, constants.%Z) [symbolic = %tuple.type (constants.%tuple.type.e28)]
  870. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.500)]
  871. // CHECK:STDOUT:
  872. // CHECK:STDOUT: fn() {
  873. // CHECK:STDOUT: !entry:
  874. // CHECK:STDOUT: %T.ref: %A.type.91f = name_ref T, %T.loc27_16.1 [symbolic = %T.loc27_16.2 (constants.%T.9c2)]
  875. // CHECK:STDOUT: %.loc28_4.1: %A.assoc_type.296 = specific_constant @A.%assoc0.loc6_39.1, @A(constants.%X) [concrete = constants.%assoc0.5f6]
  876. // CHECK:STDOUT: %F.ref: %A.assoc_type.296 = name_ref F, %.loc28_4.1 [concrete = constants.%assoc0.5f6]
  877. // CHECK:STDOUT: %T.as_type.loc28_4.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)]
  878. // CHECK:STDOUT: %.loc28_4.2: type = converted %T.ref, %T.as_type.loc28_4.1 [symbolic = %T.as_type.loc28_4.2 (constants.%T.as_type)]
  879. // CHECK:STDOUT: %impl.elem0.loc28_4.1: @CallGeneric.%.loc28_4.3 (%.ffa) = impl_witness_access constants.%A.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc28_4.2 (constants.%impl.elem0)]
  880. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z]
  881. // CHECK:STDOUT: %.loc28_11.1: %empty_struct_type = struct_literal ()
  882. // CHECK:STDOUT: %specific_impl_fn.loc28_4.1: <specific function> = specific_impl_function %impl.elem0.loc28_4.1, @F.1(constants.%X, constants.%A.facet.11f, constants.%Z) [symbolic = %specific_impl_fn.loc28_4.2 (constants.%specific_impl_fn)]
  883. // CHECK:STDOUT: %.loc28_12.1: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary_storage
  884. // CHECK:STDOUT: %.loc28_11.2: ref %Z = temporary_storage
  885. // CHECK:STDOUT: %.loc28_11.3: init %Z = class_init (), %.loc28_11.2 [concrete = constants.%Z.val]
  886. // CHECK:STDOUT: %.loc28_11.4: ref %Z = temporary %.loc28_11.2, %.loc28_11.3
  887. // CHECK:STDOUT: %.loc28_11.5: ref %Z = converted %.loc28_11.1, %.loc28_11.4
  888. // CHECK:STDOUT: %.loc28_11.6: %Z = bind_value %.loc28_11.5
  889. // CHECK:STDOUT: %.loc28_12.2: init @CallGeneric.%tuple.type (%tuple.type.e28) = call %specific_impl_fn.loc28_4.1(%.loc28_11.6) to %.loc28_12.1
  890. // CHECK:STDOUT: %.loc28_12.3: ref @CallGeneric.%tuple.type (%tuple.type.e28) = temporary %.loc28_12.1, %.loc28_12.2
  891. // CHECK:STDOUT: return
  892. // CHECK:STDOUT: }
  893. // CHECK:STDOUT: }
  894. // CHECK:STDOUT:
  895. // CHECK:STDOUT: fn @CallIndirect() {
  896. // CHECK:STDOUT: !entry:
  897. // CHECK:STDOUT: %CallGeneric.ref: %CallGeneric.type = name_ref CallGeneric, file.%CallGeneric.decl [concrete = constants.%CallGeneric]
  898. // CHECK:STDOUT: %Y1.ref: type = name_ref Y1, file.%Y1.decl [concrete = constants.%Y1]
  899. // CHECK:STDOUT: %Y2.ref: type = name_ref Y2, file.%Y2.decl [concrete = constants.%Y2]
  900. // CHECK:STDOUT: %.loc33_22: %tuple.type.24b = tuple_literal (%Y1.ref, %Y2.ref)
  901. // CHECK:STDOUT: %.loc33_24: type = converted %.loc33_22, constants.%tuple.type.a46 [concrete = constants.%tuple.type.a46]
  902. // CHECK:STDOUT: %A.facet: %A.type.91f = facet_value constants.%tuple.type.a46, (constants.%A.impl_witness.8ac) [concrete = constants.%A.facet.414]
  903. // CHECK:STDOUT: %.loc33_31: %A.type.91f = converted %.loc33_24, %A.facet [concrete = constants.%A.facet.414]
  904. // CHECK:STDOUT: %CallGeneric.specific_fn: <specific function> = specific_function %CallGeneric.ref, @CallGeneric(constants.%A.facet.414) [concrete = constants.%CallGeneric.specific_fn]
  905. // CHECK:STDOUT: %CallGeneric.call: init %empty_tuple.type = call %CallGeneric.specific_fn()
  906. // CHECK:STDOUT: return
  907. // CHECK:STDOUT: }
  908. // CHECK:STDOUT:
  909. // CHECK:STDOUT: specific @A(constants.%T.8b3) {
  910. // CHECK:STDOUT: %T.loc5_13.2 => constants.%T.8b3
  911. // CHECK:STDOUT: }
  912. // CHECK:STDOUT:
  913. // CHECK:STDOUT: specific @F.1(constants.%T.8b3, constants.%Self.753, constants.%U.2cb) {
  914. // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.2cb
  915. // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.20f
  916. // CHECK:STDOUT: %T => constants.%T.8b3
  917. // CHECK:STDOUT: %A.type => constants.%A.type.75a
  918. // CHECK:STDOUT: %Self => constants.%Self.753
  919. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.e59
  920. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%Self.as_type
  921. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.bd2
  922. // CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.44c
  923. // CHECK:STDOUT: }
  924. // CHECK:STDOUT:
  925. // CHECK:STDOUT: specific @A(constants.%W) {
  926. // CHECK:STDOUT: %T.loc5_13.2 => constants.%W
  927. // CHECK:STDOUT:
  928. // CHECK:STDOUT: !definition:
  929. // CHECK:STDOUT: %A.type => constants.%A.type.f21
  930. // CHECK:STDOUT: %Self.2 => constants.%Self.4fe
  931. // CHECK:STDOUT: %F.type => constants.%F.type.904
  932. // CHECK:STDOUT: %F => constants.%F.1ee
  933. // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.b05
  934. // CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.c82
  935. // CHECK:STDOUT: }
  936. // CHECK:STDOUT:
  937. // CHECK:STDOUT: specific @impl(constants.%V1, constants.%V2, constants.%W) {
  938. // CHECK:STDOUT: %V1.loc14_14.2 => constants.%V1
  939. // CHECK:STDOUT: %V2.loc14_25.2 => constants.%V2
  940. // CHECK:STDOUT: %W.loc14_36.2 => constants.%W
  941. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.30b
  942. // CHECK:STDOUT: %A.type.loc14_61.2 => constants.%A.type.f21
  943. // CHECK:STDOUT: %require_complete => constants.%require_complete.796
  944. // CHECK:STDOUT: %A.impl_witness => constants.%A.impl_witness.f15
  945. // CHECK:STDOUT:
  946. // CHECK:STDOUT: !definition:
  947. // CHECK:STDOUT: %F.type => constants.%F.type.b3e
  948. // CHECK:STDOUT: %F => constants.%F.d79
  949. // CHECK:STDOUT: }
  950. // CHECK:STDOUT:
  951. // CHECK:STDOUT: specific @F.2(constants.%V1, constants.%V2, constants.%W, constants.%U.753) {
  952. // CHECK:STDOUT: %U.loc17_8.1 => constants.%U.753
  953. // CHECK:STDOUT: %pattern_type.loc17_18 => constants.%pattern_type.549
  954. // CHECK:STDOUT: %W => constants.%W
  955. // CHECK:STDOUT: %V1 => constants.%V1
  956. // CHECK:STDOUT: %V2 => constants.%V2
  957. // CHECK:STDOUT: %tuple.type.loc17_42.1 => constants.%tuple.type.30b
  958. // CHECK:STDOUT: %tuple.type.loc17_42.2 => constants.%tuple.type.8ae
  959. // CHECK:STDOUT: %pattern_type.loc17_24 => constants.%pattern_type.d4a
  960. // CHECK:STDOUT:
  961. // CHECK:STDOUT: !definition:
  962. // CHECK:STDOUT: %require_complete.loc17_24 => constants.%require_complete.d4d
  963. // CHECK:STDOUT: %require_complete.loc17_19 => constants.%require_complete.ed4
  964. // CHECK:STDOUT: %F.type => constants.%F.type.b3e
  965. // CHECK:STDOUT: %F => constants.%F.d79
  966. // CHECK:STDOUT: %F.specific_fn.loc18_12.2 => constants.%F.specific_fn.7d9
  967. // CHECK:STDOUT: }
  968. // CHECK:STDOUT:
  969. // CHECK:STDOUT: specific @F.1(constants.%W, constants.%A.facet.461, constants.%U.753) {
  970. // CHECK:STDOUT: %U.loc6_8.1 => constants.%U.753
  971. // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.549
  972. // CHECK:STDOUT: %T => constants.%W
  973. // CHECK:STDOUT: %A.type => constants.%A.type.f21
  974. // CHECK:STDOUT: %Self => constants.%A.facet.461
  975. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.136
  976. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%tuple.type.30b
  977. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.8ae
  978. // CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.d4a
  979. // CHECK:STDOUT: }
  980. // CHECK:STDOUT:
  981. // CHECK:STDOUT: specific @A(constants.%X) {
  982. // CHECK:STDOUT: %T.loc5_13.2 => constants.%X
  983. // CHECK:STDOUT:
  984. // CHECK:STDOUT: !definition:
  985. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  986. // CHECK:STDOUT: %Self.2 => constants.%Self.1bb
  987. // CHECK:STDOUT: %F.type => constants.%F.type.13d
  988. // CHECK:STDOUT: %F => constants.%F.d83
  989. // CHECK:STDOUT: %A.assoc_type => constants.%A.assoc_type.296
  990. // CHECK:STDOUT: %assoc0.loc6_39.2 => constants.%assoc0.5f6
  991. // CHECK:STDOUT: }
  992. // CHECK:STDOUT:
  993. // CHECK:STDOUT: specific @impl(constants.%Y1, constants.%Y2, constants.%X) {
  994. // CHECK:STDOUT: %V1.loc14_14.2 => constants.%Y1
  995. // CHECK:STDOUT: %V2.loc14_25.2 => constants.%Y2
  996. // CHECK:STDOUT: %W.loc14_36.2 => constants.%X
  997. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.a46
  998. // CHECK:STDOUT: %A.type.loc14_61.2 => constants.%A.type.91f
  999. // CHECK:STDOUT: %require_complete => constants.%complete_type.d76
  1000. // CHECK:STDOUT: %A.impl_witness => constants.%A.impl_witness.8ac
  1001. // CHECK:STDOUT:
  1002. // CHECK:STDOUT: !definition:
  1003. // CHECK:STDOUT: %F.type => constants.%F.type.bf7
  1004. // CHECK:STDOUT: %F => constants.%F.93b
  1005. // CHECK:STDOUT: }
  1006. // CHECK:STDOUT:
  1007. // CHECK:STDOUT: specific @F.2(constants.%Y1, constants.%Y2, constants.%X, constants.%Z) {
  1008. // CHECK:STDOUT: %U.loc17_8.1 => constants.%Z
  1009. // CHECK:STDOUT: %pattern_type.loc17_18 => constants.%pattern_type.8f9
  1010. // CHECK:STDOUT: %W => constants.%X
  1011. // CHECK:STDOUT: %V1 => constants.%Y1
  1012. // CHECK:STDOUT: %V2 => constants.%Y2
  1013. // CHECK:STDOUT: %tuple.type.loc17_42.1 => constants.%tuple.type.a46
  1014. // CHECK:STDOUT: %tuple.type.loc17_42.2 => constants.%tuple.type.415
  1015. // CHECK:STDOUT: %pattern_type.loc17_24 => constants.%pattern_type.0b2
  1016. // CHECK:STDOUT:
  1017. // CHECK:STDOUT: !definition:
  1018. // CHECK:STDOUT: %require_complete.loc17_24 => constants.%complete_type.aa8
  1019. // CHECK:STDOUT: %require_complete.loc17_19 => constants.%complete_type.357
  1020. // CHECK:STDOUT: %F.type => constants.%F.type.bf7
  1021. // CHECK:STDOUT: %F => constants.%F.93b
  1022. // CHECK:STDOUT: %F.specific_fn.loc18_12.2 => constants.%F.specific_fn.79b
  1023. // CHECK:STDOUT: }
  1024. // CHECK:STDOUT:
  1025. // CHECK:STDOUT: specific @CallGeneric(constants.%T.9c2) {
  1026. // CHECK:STDOUT: %T.loc27_16.2 => constants.%T.9c2
  1027. // CHECK:STDOUT: }
  1028. // CHECK:STDOUT:
  1029. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.11f, constants.%Z) {
  1030. // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z
  1031. // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.8f9
  1032. // CHECK:STDOUT: %T => constants.%X
  1033. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  1034. // CHECK:STDOUT: %Self => constants.%A.facet.11f
  1035. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  1036. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%T.as_type
  1037. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.e28
  1038. // CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.f25
  1039. // CHECK:STDOUT: }
  1040. // CHECK:STDOUT:
  1041. // CHECK:STDOUT: specific @CallGeneric(constants.%A.facet.414) {
  1042. // CHECK:STDOUT: %T.loc27_16.2 => constants.%A.facet.414
  1043. // CHECK:STDOUT:
  1044. // CHECK:STDOUT: !definition:
  1045. // CHECK:STDOUT: %T.as_type.loc28_4.2 => constants.%tuple.type.a46
  1046. // CHECK:STDOUT: %A.lookup_impl_witness => constants.%A.impl_witness.8ac
  1047. // CHECK:STDOUT: %A.facet => constants.%A.facet.414
  1048. // CHECK:STDOUT: %.loc28_4.3 => constants.%.406
  1049. // CHECK:STDOUT: %impl.elem0.loc28_4.2 => constants.%F.93b
  1050. // CHECK:STDOUT: %specific_impl_fn.loc28_4.2 => constants.%F.specific_fn.79b
  1051. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.415
  1052. // CHECK:STDOUT: %require_complete => constants.%complete_type.aa8
  1053. // CHECK:STDOUT: }
  1054. // CHECK:STDOUT:
  1055. // CHECK:STDOUT: specific @F.1(constants.%X, constants.%A.facet.414, constants.%Z) {
  1056. // CHECK:STDOUT: %U.loc6_8.1 => constants.%Z
  1057. // CHECK:STDOUT: %pattern_type.loc6_18 => constants.%pattern_type.8f9
  1058. // CHECK:STDOUT: %T => constants.%X
  1059. // CHECK:STDOUT: %A.type => constants.%A.type.91f
  1060. // CHECK:STDOUT: %Self => constants.%A.facet.414
  1061. // CHECK:STDOUT: %tuple.type.loc6_38.1 => constants.%tuple.type.a0c
  1062. // CHECK:STDOUT: %Self.as_type.loc6_38.1 => constants.%tuple.type.a46
  1063. // CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.415
  1064. // CHECK:STDOUT: %pattern_type.loc6_24 => constants.%pattern_type.0b2
  1065. // CHECK:STDOUT: }
  1066. // CHECK:STDOUT: