generic_method.carbon 79 KB

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