generic_method.carbon 92 KB

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