generic_method.carbon 74 KB

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