impl_forall.carbon 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/destroy.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/impl_forall.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/impl_forall.carbon
  14. // --- impl_forall.carbon
  15. library "[[@TEST_NAME]]";
  16. class A(T:! type) {
  17. var n: T;
  18. }
  19. interface I(U:! type) {
  20. fn F[self: Self]() -> U;
  21. }
  22. impl forall [V:! type] A(V) as I(V) {
  23. fn F[self: Self]() -> V {
  24. return self.n;
  25. }
  26. }
  27. fn TestGeneric[W:! type](a: A(W)) -> W {
  28. return a.(I(W).F)();
  29. }
  30. fn TestSpecific(a: A({})) -> {} {
  31. return a.(I({}).F)();
  32. }
  33. // CHECK:STDOUT: --- impl_forall.carbon
  34. // CHECK:STDOUT:
  35. // CHECK:STDOUT: constants {
  36. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  37. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  38. // CHECK:STDOUT: %A.type: type = generic_class_type @A [concrete]
  39. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  40. // CHECK:STDOUT: %A.generic: %A.type = struct_value () [concrete]
  41. // CHECK:STDOUT: %A.13025a.1: type = class_type @A, @A(%T) [symbolic]
  42. // CHECK:STDOUT: %require_complete.4aeca8.1: <witness> = require_complete_type %T [symbolic]
  43. // CHECK:STDOUT: %A.elem.1ceb36.1: type = unbound_element_type %A.13025a.1, %T [symbolic]
  44. // CHECK:STDOUT: %struct_type.n.848971.1: type = struct_type {.n: %T} [symbolic]
  45. // CHECK:STDOUT: %complete_type.84bb3d.1: <witness> = complete_type_witness %struct_type.n.848971.1 [symbolic]
  46. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic]
  47. // CHECK:STDOUT: %I.type.dac: type = generic_interface_type @I [concrete]
  48. // CHECK:STDOUT: %I.generic: %I.type.dac = struct_value () [concrete]
  49. // CHECK:STDOUT: %I.type.325e65.1: type = facet_type <@I, @I(%U)> [symbolic]
  50. // CHECK:STDOUT: %Self.209206.1: %I.type.325e65.1 = bind_symbolic_name Self, 1 [symbolic]
  51. // CHECK:STDOUT: %Self.as_type.928: type = facet_access_type %Self.209206.1 [symbolic]
  52. // CHECK:STDOUT: %pattern_type.4be: type = pattern_type %Self.as_type.928 [symbolic]
  53. // CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %U [symbolic]
  54. // CHECK:STDOUT: %F.type.2aef59.1: type = fn_type @F.1, @I(%U) [symbolic]
  55. // CHECK:STDOUT: %F.bb2dd4.1: %F.type.2aef59.1 = struct_value () [symbolic]
  56. // CHECK:STDOUT: %I.assoc_type.1e5078.1: type = assoc_entity_type @I, @I(%U) [symbolic]
  57. // CHECK:STDOUT: %assoc0.8f0422.1: %I.assoc_type.1e5078.1 = assoc_entity element0, @I.%F.decl [symbolic]
  58. // CHECK:STDOUT: %V: type = bind_symbolic_name V, 0 [symbolic]
  59. // CHECK:STDOUT: %A.13025a.2: type = class_type @A, @A(%V) [symbolic]
  60. // CHECK:STDOUT: %I.type.325e65.2: type = facet_type <@I, @I(%V)> [symbolic]
  61. // CHECK:STDOUT: %Self.209206.2: %I.type.325e65.2 = bind_symbolic_name Self, 1 [symbolic]
  62. // CHECK:STDOUT: %F.type.2aef59.2: type = fn_type @F.1, @I(%V) [symbolic]
  63. // CHECK:STDOUT: %F.bb2dd4.2: %F.type.2aef59.2 = struct_value () [symbolic]
  64. // CHECK:STDOUT: %I.assoc_type.1e5078.2: type = assoc_entity_type @I, @I(%V) [symbolic]
  65. // CHECK:STDOUT: %assoc0.8f0422.2: %I.assoc_type.1e5078.2 = assoc_entity element0, @I.%F.decl [symbolic]
  66. // CHECK:STDOUT: %require_complete.cfebb2.1: <witness> = require_complete_type %I.type.325e65.2 [symbolic]
  67. // CHECK:STDOUT: %I.impl_witness.40ab31.1: <witness> = impl_witness file.%I.impl_witness_table, @impl.27e(%V) [symbolic]
  68. // CHECK:STDOUT: %pattern_type.68d8d3.1: type = pattern_type %A.13025a.2 [symbolic]
  69. // CHECK:STDOUT: %pattern_type.7dcd0a.2: type = pattern_type %V [symbolic]
  70. // CHECK:STDOUT: %F.type.0fea45.1: type = fn_type @F.2, @impl.27e(%V) [symbolic]
  71. // CHECK:STDOUT: %F.d6ae34.1: %F.type.0fea45.1 = struct_value () [symbolic]
  72. // CHECK:STDOUT: %I.facet.de3: %I.type.325e65.2 = facet_value %A.13025a.2, (%I.impl_witness.40ab31.1) [symbolic]
  73. // CHECK:STDOUT: %require_complete.4aeca8.2: <witness> = require_complete_type %V [symbolic]
  74. // CHECK:STDOUT: %A.elem.1ceb36.2: type = unbound_element_type %A.13025a.2, %V [symbolic]
  75. // CHECK:STDOUT: %struct_type.n.848971.2: type = struct_type {.n: %V} [symbolic]
  76. // CHECK:STDOUT: %complete_type.84bb3d.2: <witness> = complete_type_witness %struct_type.n.848971.2 [symbolic]
  77. // CHECK:STDOUT: %require_complete.5b8aee.1: <witness> = require_complete_type %A.13025a.2 [symbolic]
  78. // CHECK:STDOUT: %W: type = bind_symbolic_name W, 0 [symbolic]
  79. // CHECK:STDOUT: %A.13025a.3: type = class_type @A, @A(%W) [symbolic]
  80. // CHECK:STDOUT: %pattern_type.68d8d3.2: type = pattern_type %A.13025a.3 [symbolic]
  81. // CHECK:STDOUT: %pattern_type.7dcd0a.3: type = pattern_type %W [symbolic]
  82. // CHECK:STDOUT: %TestGeneric.type: type = fn_type @TestGeneric [concrete]
  83. // CHECK:STDOUT: %TestGeneric: %TestGeneric.type = struct_value () [concrete]
  84. // CHECK:STDOUT: %require_complete.4aeca8.3: <witness> = require_complete_type %W [symbolic]
  85. // CHECK:STDOUT: %A.elem.1ceb36.3: type = unbound_element_type %A.13025a.3, %W [symbolic]
  86. // CHECK:STDOUT: %struct_type.n.848971.3: type = struct_type {.n: %W} [symbolic]
  87. // CHECK:STDOUT: %complete_type.84bb3d.3: <witness> = complete_type_witness %struct_type.n.848971.3 [symbolic]
  88. // CHECK:STDOUT: %require_complete.5b8aee.2: <witness> = require_complete_type %A.13025a.3 [symbolic]
  89. // CHECK:STDOUT: %I.type.325e65.3: type = facet_type <@I, @I(%W)> [symbolic]
  90. // CHECK:STDOUT: %Self.209206.3: %I.type.325e65.3 = bind_symbolic_name Self, 1 [symbolic]
  91. // CHECK:STDOUT: %F.type.2aef59.3: type = fn_type @F.1, @I(%W) [symbolic]
  92. // CHECK:STDOUT: %F.bb2dd4.3: %F.type.2aef59.3 = struct_value () [symbolic]
  93. // CHECK:STDOUT: %I.assoc_type.1e5078.3: type = assoc_entity_type @I, @I(%W) [symbolic]
  94. // CHECK:STDOUT: %assoc0.8f0422.3: %I.assoc_type.1e5078.3 = assoc_entity element0, @I.%F.decl [symbolic]
  95. // CHECK:STDOUT: %require_complete.cfebb2.2: <witness> = require_complete_type %I.type.325e65.3 [symbolic]
  96. // CHECK:STDOUT: %I.impl_witness.40ab31.2: <witness> = impl_witness file.%I.impl_witness_table, @impl.27e(%W) [symbolic]
  97. // CHECK:STDOUT: %F.type.0fea45.2: type = fn_type @F.2, @impl.27e(%W) [symbolic]
  98. // CHECK:STDOUT: %F.d6ae34.2: %F.type.0fea45.2 = struct_value () [symbolic]
  99. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %A.13025a.3, @I, @I(%W) [symbolic]
  100. // CHECK:STDOUT: %I.facet.6d2: %I.type.325e65.3 = facet_value %A.13025a.3, (%I.lookup_impl_witness) [symbolic]
  101. // CHECK:STDOUT: %.fe1: type = fn_type_with_self_type %F.type.2aef59.3, %I.facet.6d2 [symbolic]
  102. // CHECK:STDOUT: %impl.elem0: %.fe1 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
  103. // CHECK:STDOUT: %specific_impl_fn: <specific function> = specific_impl_function %impl.elem0, @F.1(%W, %I.facet.6d2) [symbolic]
  104. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  105. // CHECK:STDOUT: %A.235: type = class_type @A, @A(%empty_struct_type) [concrete]
  106. // CHECK:STDOUT: %pattern_type.496: type = pattern_type %A.235 [concrete]
  107. // CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
  108. // CHECK:STDOUT: %TestSpecific.type: type = fn_type @TestSpecific [concrete]
  109. // CHECK:STDOUT: %TestSpecific: %TestSpecific.type = struct_value () [concrete]
  110. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  111. // CHECK:STDOUT: %A.elem.2af: type = unbound_element_type %A.235, %empty_struct_type [concrete]
  112. // CHECK:STDOUT: %struct_type.n.91c: type = struct_type {.n: %empty_struct_type} [concrete]
  113. // CHECK:STDOUT: %complete_type.0a6: <witness> = complete_type_witness %struct_type.n.91c [concrete]
  114. // CHECK:STDOUT: %I.type.885: type = facet_type <@I, @I(%empty_struct_type)> [concrete]
  115. // CHECK:STDOUT: %Self.4e2: %I.type.885 = bind_symbolic_name Self, 1 [symbolic]
  116. // CHECK:STDOUT: %F.type.684: type = fn_type @F.1, @I(%empty_struct_type) [concrete]
  117. // CHECK:STDOUT: %F.a8d: %F.type.684 = struct_value () [concrete]
  118. // CHECK:STDOUT: %I.assoc_type.22c: type = assoc_entity_type @I, @I(%empty_struct_type) [concrete]
  119. // CHECK:STDOUT: %assoc0.722: %I.assoc_type.22c = assoc_entity element0, @I.%F.decl [concrete]
  120. // CHECK:STDOUT: %complete_type.788: <witness> = complete_type_witness %I.type.885 [concrete]
  121. // CHECK:STDOUT: %I.impl_witness.0f2: <witness> = impl_witness file.%I.impl_witness_table, @impl.27e(%empty_struct_type) [concrete]
  122. // CHECK:STDOUT: %F.type.875: type = fn_type @F.2, @impl.27e(%empty_struct_type) [concrete]
  123. // CHECK:STDOUT: %F.158: %F.type.875 = struct_value () [concrete]
  124. // CHECK:STDOUT: %I.facet.bd5: %I.type.885 = facet_value %A.235, (%I.impl_witness.0f2) [concrete]
  125. // CHECK:STDOUT: %.8fd: type = fn_type_with_self_type %F.type.684, %I.facet.bd5 [concrete]
  126. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.158, @F.2(%empty_struct_type) [concrete]
  127. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  128. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  129. // CHECK:STDOUT: %Op.type.069: type = fn_type @Op.2, @impl.49c(%empty_struct_type) [concrete]
  130. // CHECK:STDOUT: %Op.d5a: %Op.type.069 = struct_value () [concrete]
  131. // CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete]
  132. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function %Op.d5a, @Op.2(%empty_struct_type) [concrete]
  133. // CHECK:STDOUT: }
  134. // CHECK:STDOUT:
  135. // CHECK:STDOUT: imports {
  136. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  137. // CHECK:STDOUT: .Destroy = %Core.Destroy
  138. // CHECK:STDOUT: import Core//prelude
  139. // CHECK:STDOUT: import Core//prelude/...
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: file {
  145. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  146. // CHECK:STDOUT: .Core = imports.%Core
  147. // CHECK:STDOUT: .A = %A.decl
  148. // CHECK:STDOUT: .I = %I.decl
  149. // CHECK:STDOUT: .TestGeneric = %TestGeneric.decl
  150. // CHECK:STDOUT: .TestSpecific = %TestSpecific.decl
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT: %Core.import = import Core
  153. // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [concrete = constants.%A.generic] {
  154. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  155. // CHECK:STDOUT: } {
  156. // CHECK:STDOUT: %T.loc3_9.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc3_9.2 (constants.%T)]
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT: %I.decl: %I.type.dac = interface_decl @I [concrete = constants.%I.generic] {
  159. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 0 [concrete]
  160. // CHECK:STDOUT: } {
  161. // CHECK:STDOUT: %U.loc7_13.1: type = bind_symbolic_name U, 0 [symbolic = %U.loc7_13.2 (constants.%U)]
  162. // CHECK:STDOUT: }
  163. // CHECK:STDOUT: impl_decl @impl.27e [concrete] {
  164. // CHECK:STDOUT: %V.patt: %pattern_type.98f = symbolic_binding_pattern V, 0 [concrete]
  165. // CHECK:STDOUT: } {
  166. // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  167. // CHECK:STDOUT: %V.ref.loc11_26: type = name_ref V, %V.loc11_14.1 [symbolic = %V.loc11_14.2 (constants.%V)]
  168. // CHECK:STDOUT: %A.loc11_27.1: type = class_type @A, @A(constants.%V) [symbolic = %A.loc11_27.2 (constants.%A.13025a.2)]
  169. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  170. // CHECK:STDOUT: %V.ref.loc11_34: type = name_ref V, %V.loc11_14.1 [symbolic = %V.loc11_14.2 (constants.%V)]
  171. // CHECK:STDOUT: %I.type.loc11_35.1: type = facet_type <@I, @I(constants.%V)> [symbolic = %I.type.loc11_35.2 (constants.%I.type.325e65.2)]
  172. // CHECK:STDOUT: %V.loc11_14.1: type = bind_symbolic_name V, 0 [symbolic = %V.loc11_14.2 (constants.%V)]
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (@impl.27e.%F.decl), @impl.27e [concrete]
  175. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness %I.impl_witness_table, @impl.27e(constants.%V) [symbolic = @impl.27e.%I.impl_witness (constants.%I.impl_witness.40ab31.1)]
  176. // CHECK:STDOUT: %TestGeneric.decl: %TestGeneric.type = fn_decl @TestGeneric [concrete = constants.%TestGeneric] {
  177. // CHECK:STDOUT: %W.patt: %pattern_type.98f = symbolic_binding_pattern W, 0 [concrete]
  178. // CHECK:STDOUT: %a.patt: @TestGeneric.%pattern_type.loc17_26 (%pattern_type.68d8d3.2) = binding_pattern a [concrete]
  179. // CHECK:STDOUT: %a.param_patt: @TestGeneric.%pattern_type.loc17_26 (%pattern_type.68d8d3.2) = value_param_pattern %a.patt, call_param0 [concrete]
  180. // CHECK:STDOUT: %return.patt: @TestGeneric.%pattern_type.loc17_35 (%pattern_type.7dcd0a.3) = return_slot_pattern [concrete]
  181. // CHECK:STDOUT: %return.param_patt: @TestGeneric.%pattern_type.loc17_35 (%pattern_type.7dcd0a.3) = out_param_pattern %return.patt, call_param1 [concrete]
  182. // CHECK:STDOUT: } {
  183. // CHECK:STDOUT: %W.ref.loc17_38: type = name_ref W, %W.loc17_16.1 [symbolic = %W.loc17_16.2 (constants.%W)]
  184. // CHECK:STDOUT: %W.loc17_16.1: type = bind_symbolic_name W, 0 [symbolic = %W.loc17_16.2 (constants.%W)]
  185. // CHECK:STDOUT: %a.param: @TestGeneric.%A.loc17_32.2 (%A.13025a.3) = value_param call_param0
  186. // CHECK:STDOUT: %.loc17: type = splice_block %A.loc17_32.1 [symbolic = %A.loc17_32.2 (constants.%A.13025a.3)] {
  187. // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  188. // CHECK:STDOUT: %W.ref.loc17_31: type = name_ref W, %W.loc17_16.1 [symbolic = %W.loc17_16.2 (constants.%W)]
  189. // CHECK:STDOUT: %A.loc17_32.1: type = class_type @A, @A(constants.%W) [symbolic = %A.loc17_32.2 (constants.%A.13025a.3)]
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT: %a: @TestGeneric.%A.loc17_32.2 (%A.13025a.3) = bind_name a, %a.param
  192. // CHECK:STDOUT: %return.param: ref @TestGeneric.%W.loc17_16.2 (%W) = out_param call_param1
  193. // CHECK:STDOUT: %return: ref @TestGeneric.%W.loc17_16.2 (%W) = return_slot %return.param
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT: %TestSpecific.decl: %TestSpecific.type = fn_decl @TestSpecific [concrete = constants.%TestSpecific] {
  196. // CHECK:STDOUT: %a.patt: %pattern_type.496 = binding_pattern a [concrete]
  197. // CHECK:STDOUT: %a.param_patt: %pattern_type.496 = value_param_pattern %a.patt, call_param0 [concrete]
  198. // CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern [concrete]
  199. // CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern %return.patt, call_param1 [concrete]
  200. // CHECK:STDOUT: } {
  201. // CHECK:STDOUT: %.loc21_31.1: %empty_struct_type = struct_literal ()
  202. // CHECK:STDOUT: %.loc21_31.2: type = converted %.loc21_31.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  203. // CHECK:STDOUT: %a.param: %A.235 = value_param call_param0
  204. // CHECK:STDOUT: %.loc21_24.1: type = splice_block %A [concrete = constants.%A.235] {
  205. // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [concrete = constants.%A.generic]
  206. // CHECK:STDOUT: %.loc21_23: %empty_struct_type = struct_literal ()
  207. // CHECK:STDOUT: %.loc21_24.2: type = converted %.loc21_23, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  208. // CHECK:STDOUT: %A: type = class_type @A, @A(constants.%empty_struct_type) [concrete = constants.%A.235]
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT: %a: %A.235 = bind_name a, %a.param
  211. // CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param1
  212. // CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT:
  216. // CHECK:STDOUT: generic interface @I(%U.loc7_13.1: type) {
  217. // CHECK:STDOUT: %U.loc7_13.2: type = bind_symbolic_name U, 0 [symbolic = %U.loc7_13.2 (constants.%U)]
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: !definition:
  220. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U.loc7_13.2)> [symbolic = %I.type (constants.%I.type.325e65.1)]
  221. // CHECK:STDOUT: %Self.2: @I.%I.type (%I.type.325e65.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209206.1)]
  222. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @I(%U.loc7_13.2) [symbolic = %F.type (constants.%F.type.2aef59.1)]
  223. // CHECK:STDOUT: %F: @I.%F.type (%F.type.2aef59.1) = struct_value () [symbolic = %F (constants.%F.bb2dd4.1)]
  224. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%U.loc7_13.2) [symbolic = %I.assoc_type (constants.%I.assoc_type.1e5078.1)]
  225. // CHECK:STDOUT: %assoc0.loc8_26.2: @I.%I.assoc_type (%I.assoc_type.1e5078.1) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc8_26.2 (constants.%assoc0.8f0422.1)]
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: interface {
  228. // CHECK:STDOUT: %Self.1: @I.%I.type (%I.type.325e65.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.209206.1)]
  229. // CHECK:STDOUT: %F.decl: @I.%F.type (%F.type.2aef59.1) = fn_decl @F.1 [symbolic = @I.%F (constants.%F.bb2dd4.1)] {
  230. // CHECK:STDOUT: %self.patt: @F.1.%pattern_type.loc8_8 (%pattern_type.4be) = binding_pattern self [concrete]
  231. // CHECK:STDOUT: %self.param_patt: @F.1.%pattern_type.loc8_8 (%pattern_type.4be) = value_param_pattern %self.patt, call_param0 [concrete]
  232. // CHECK:STDOUT: %return.patt: @F.1.%pattern_type.loc8_22 (%pattern_type.7dcd0a.1) = return_slot_pattern [concrete]
  233. // CHECK:STDOUT: %return.param_patt: @F.1.%pattern_type.loc8_22 (%pattern_type.7dcd0a.1) = out_param_pattern %return.patt, call_param1 [concrete]
  234. // CHECK:STDOUT: } {
  235. // CHECK:STDOUT: %U.ref: type = name_ref U, @I.%U.loc7_13.1 [symbolic = %U (constants.%U)]
  236. // CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type.928) = value_param call_param0
  237. // CHECK:STDOUT: %.loc8_14.1: type = splice_block %.loc8_14.3 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type.928)] {
  238. // CHECK:STDOUT: %.loc8_14.2: @F.1.%I.type (%I.type.325e65.1) = specific_constant @I.%Self.1, @I(constants.%U) [symbolic = %Self (constants.%Self.209206.1)]
  239. // CHECK:STDOUT: %Self.ref: @F.1.%I.type (%I.type.325e65.1) = name_ref Self, %.loc8_14.2 [symbolic = %Self (constants.%Self.209206.1)]
  240. // CHECK:STDOUT: %Self.as_type.loc8_14.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type.928)]
  241. // CHECK:STDOUT: %.loc8_14.3: type = converted %Self.ref, %Self.as_type.loc8_14.2 [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type.928)]
  242. // CHECK:STDOUT: }
  243. // CHECK:STDOUT: %self: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type.928) = bind_name self, %self.param
  244. // CHECK:STDOUT: %return.param: ref @F.1.%U (%U) = out_param call_param1
  245. // CHECK:STDOUT: %return: ref @F.1.%U (%U) = return_slot %return.param
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT: %assoc0.loc8_26.1: @I.%I.assoc_type (%I.assoc_type.1e5078.1) = assoc_entity element0, %F.decl [symbolic = %assoc0.loc8_26.2 (constants.%assoc0.8f0422.1)]
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: !members:
  250. // CHECK:STDOUT: .Self = %Self.1
  251. // CHECK:STDOUT: .U = <poisoned>
  252. // CHECK:STDOUT: .F = %assoc0.loc8_26.1
  253. // CHECK:STDOUT: witness = (%F.decl)
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: generic impl @impl.27e(%V.loc11_14.1: type) {
  258. // CHECK:STDOUT: %V.loc11_14.2: type = bind_symbolic_name V, 0 [symbolic = %V.loc11_14.2 (constants.%V)]
  259. // CHECK:STDOUT: %A.loc11_27.2: type = class_type @A, @A(%V.loc11_14.2) [symbolic = %A.loc11_27.2 (constants.%A.13025a.2)]
  260. // CHECK:STDOUT: %I.type.loc11_35.2: type = facet_type <@I, @I(%V.loc11_14.2)> [symbolic = %I.type.loc11_35.2 (constants.%I.type.325e65.2)]
  261. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %I.type.loc11_35.2 [symbolic = %require_complete (constants.%require_complete.cfebb2.1)]
  262. // CHECK:STDOUT: %I.impl_witness: <witness> = impl_witness file.%I.impl_witness_table, @impl.27e(%V.loc11_14.2) [symbolic = %I.impl_witness (constants.%I.impl_witness.40ab31.1)]
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: !definition:
  265. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl.27e(%V.loc11_14.2) [symbolic = %F.type (constants.%F.type.0fea45.1)]
  266. // CHECK:STDOUT: %F: @impl.27e.%F.type (%F.type.0fea45.1) = struct_value () [symbolic = %F (constants.%F.d6ae34.1)]
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: impl: %A.loc11_27.1 as %I.type.loc11_35.1 {
  269. // CHECK:STDOUT: %F.decl: @impl.27e.%F.type (%F.type.0fea45.1) = fn_decl @F.2 [symbolic = @impl.27e.%F (constants.%F.d6ae34.1)] {
  270. // CHECK:STDOUT: %self.patt: @F.2.%pattern_type.loc12_8 (%pattern_type.68d8d3.1) = binding_pattern self [concrete]
  271. // CHECK:STDOUT: %self.param_patt: @F.2.%pattern_type.loc12_8 (%pattern_type.68d8d3.1) = value_param_pattern %self.patt, call_param0 [concrete]
  272. // CHECK:STDOUT: %return.patt: @F.2.%pattern_type.loc12_22 (%pattern_type.7dcd0a.2) = return_slot_pattern [concrete]
  273. // CHECK:STDOUT: %return.param_patt: @F.2.%pattern_type.loc12_22 (%pattern_type.7dcd0a.2) = out_param_pattern %return.patt, call_param1 [concrete]
  274. // CHECK:STDOUT: } {
  275. // CHECK:STDOUT: %V.ref: type = name_ref V, @impl.27e.%V.loc11_14.1 [symbolic = %V (constants.%V)]
  276. // CHECK:STDOUT: %self.param: @F.2.%A (%A.13025a.2) = value_param call_param0
  277. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.27e.%A.loc11_27.1 [symbolic = %A (constants.%A.13025a.2)]
  278. // CHECK:STDOUT: %self: @F.2.%A (%A.13025a.2) = bind_name self, %self.param
  279. // CHECK:STDOUT: %return.param: ref @F.2.%V (%V) = out_param call_param1
  280. // CHECK:STDOUT: %return: ref @F.2.%V (%V) = return_slot %return.param
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: !members:
  284. // CHECK:STDOUT: .V = <poisoned>
  285. // CHECK:STDOUT: .F = %F.decl
  286. // CHECK:STDOUT: witness = file.%I.impl_witness
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT: }
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: generic class @A(%T.loc3_9.1: type) {
  291. // CHECK:STDOUT: %T.loc3_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc3_9.2 (constants.%T)]
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: !definition:
  294. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.loc3_9.2 [symbolic = %require_complete (constants.%require_complete.4aeca8.1)]
  295. // CHECK:STDOUT: %A: type = class_type @A, @A(%T.loc3_9.2) [symbolic = %A (constants.%A.13025a.1)]
  296. // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %T.loc3_9.2 [symbolic = %A.elem (constants.%A.elem.1ceb36.1)]
  297. // CHECK:STDOUT: %struct_type.n.loc5_1.2: type = struct_type {.n: @A.%T.loc3_9.2 (%T)} [symbolic = %struct_type.n.loc5_1.2 (constants.%struct_type.n.848971.1)]
  298. // CHECK:STDOUT: %complete_type.loc5_1.2: <witness> = complete_type_witness %struct_type.n.loc5_1.2 [symbolic = %complete_type.loc5_1.2 (constants.%complete_type.84bb3d.1)]
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: class {
  301. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc3_9.1 [symbolic = %T.loc3_9.2 (constants.%T)]
  302. // CHECK:STDOUT: %.loc4: @A.%A.elem (%A.elem.1ceb36.1) = field_decl n, element0 [concrete]
  303. // CHECK:STDOUT: %struct_type.n.loc5_1.1: type = struct_type {.n: %T} [symbolic = %struct_type.n.loc5_1.2 (constants.%struct_type.n.848971.1)]
  304. // CHECK:STDOUT: %complete_type.loc5_1.1: <witness> = complete_type_witness %struct_type.n.loc5_1.1 [symbolic = %complete_type.loc5_1.2 (constants.%complete_type.84bb3d.1)]
  305. // CHECK:STDOUT: complete_type_witness = %complete_type.loc5_1.1
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: !members:
  308. // CHECK:STDOUT: .Self = constants.%A.13025a.1
  309. // CHECK:STDOUT: .T = <poisoned>
  310. // CHECK:STDOUT: .n = %.loc4
  311. // CHECK:STDOUT: }
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: generic fn @F.1(@I.%U.loc7_13.1: type, @I.%Self.1: @I.%I.type (%I.type.325e65.1)) {
  315. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 0 [symbolic = %U (constants.%U)]
  316. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(%U)> [symbolic = %I.type (constants.%I.type.325e65.1)]
  317. // CHECK:STDOUT: %Self: @F.1.%I.type (%I.type.325e65.1) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.209206.1)]
  318. // CHECK:STDOUT: %Self.as_type.loc8_14.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc8_14.1 (constants.%Self.as_type.928)]
  319. // CHECK:STDOUT: %pattern_type.loc8_8: type = pattern_type %Self.as_type.loc8_14.1 [symbolic = %pattern_type.loc8_8 (constants.%pattern_type.4be)]
  320. // CHECK:STDOUT: %pattern_type.loc8_22: type = pattern_type %U [symbolic = %pattern_type.loc8_22 (constants.%pattern_type.7dcd0a.1)]
  321. // CHECK:STDOUT:
  322. // CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc8_14.1 (%Self.as_type.928)) -> @F.1.%U (%U);
  323. // CHECK:STDOUT: }
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: generic fn @F.2(@impl.27e.%V.loc11_14.1: type) {
  326. // CHECK:STDOUT: %V: type = bind_symbolic_name V, 0 [symbolic = %V (constants.%V)]
  327. // CHECK:STDOUT: %A: type = class_type @A, @A(%V) [symbolic = %A (constants.%A.13025a.2)]
  328. // CHECK:STDOUT: %pattern_type.loc12_8: type = pattern_type %A [symbolic = %pattern_type.loc12_8 (constants.%pattern_type.68d8d3.1)]
  329. // CHECK:STDOUT: %pattern_type.loc12_22: type = pattern_type %V [symbolic = %pattern_type.loc12_22 (constants.%pattern_type.7dcd0a.2)]
  330. // CHECK:STDOUT:
  331. // CHECK:STDOUT: !definition:
  332. // CHECK:STDOUT: %require_complete.loc12_22: <witness> = require_complete_type %V [symbolic = %require_complete.loc12_22 (constants.%require_complete.4aeca8.2)]
  333. // CHECK:STDOUT: %require_complete.loc12_12: <witness> = require_complete_type %A [symbolic = %require_complete.loc12_12 (constants.%require_complete.5b8aee.1)]
  334. // CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %V [symbolic = %A.elem (constants.%A.elem.1ceb36.2)]
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: fn(%self.param: @F.2.%A (%A.13025a.2)) -> @F.2.%V (%V) {
  337. // CHECK:STDOUT: !entry:
  338. // CHECK:STDOUT: %self.ref: @F.2.%A (%A.13025a.2) = name_ref self, %self
  339. // CHECK:STDOUT: %n.ref: @F.2.%A.elem (%A.elem.1ceb36.2) = name_ref n, @A.%.loc4 [concrete = @A.%.loc4]
  340. // CHECK:STDOUT: %.loc13_16.1: ref @F.2.%V (%V) = class_element_access %self.ref, element0
  341. // CHECK:STDOUT: %.loc13_16.2: @F.2.%V (%V) = bind_value %.loc13_16.1
  342. // CHECK:STDOUT: return %.loc13_16.2
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT: }
  345. // CHECK:STDOUT:
  346. // CHECK:STDOUT: generic fn @TestGeneric(%W.loc17_16.1: type) {
  347. // CHECK:STDOUT: %W.loc17_16.2: type = bind_symbolic_name W, 0 [symbolic = %W.loc17_16.2 (constants.%W)]
  348. // CHECK:STDOUT: %A.loc17_32.2: type = class_type @A, @A(%W.loc17_16.2) [symbolic = %A.loc17_32.2 (constants.%A.13025a.3)]
  349. // CHECK:STDOUT: %pattern_type.loc17_26: type = pattern_type %A.loc17_32.2 [symbolic = %pattern_type.loc17_26 (constants.%pattern_type.68d8d3.2)]
  350. // CHECK:STDOUT: %pattern_type.loc17_35: type = pattern_type %W.loc17_16.2 [symbolic = %pattern_type.loc17_35 (constants.%pattern_type.7dcd0a.3)]
  351. // CHECK:STDOUT:
  352. // CHECK:STDOUT: !definition:
  353. // CHECK:STDOUT: %require_complete.loc17_35: <witness> = require_complete_type %W.loc17_16.2 [symbolic = %require_complete.loc17_35 (constants.%require_complete.4aeca8.3)]
  354. // CHECK:STDOUT: %require_complete.loc17_27: <witness> = require_complete_type %A.loc17_32.2 [symbolic = %require_complete.loc17_27 (constants.%require_complete.5b8aee.2)]
  355. // CHECK:STDOUT: %I.type.loc18_16.2: type = facet_type <@I, @I(%W.loc17_16.2)> [symbolic = %I.type.loc18_16.2 (constants.%I.type.325e65.3)]
  356. // CHECK:STDOUT: %require_complete.loc18: <witness> = require_complete_type %I.type.loc18_16.2 [symbolic = %require_complete.loc18 (constants.%require_complete.cfebb2.2)]
  357. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I, @I(%W.loc17_16.2) [symbolic = %I.assoc_type (constants.%I.assoc_type.1e5078.3)]
  358. // CHECK:STDOUT: %assoc0: @TestGeneric.%I.assoc_type (%I.assoc_type.1e5078.3) = assoc_entity element0, @I.%F.decl [symbolic = %assoc0 (constants.%assoc0.8f0422.3)]
  359. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %A.loc17_32.2, @I, @I(%W.loc17_16.2) [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
  360. // CHECK:STDOUT: %F.type: type = fn_type @F.1, @I(%W.loc17_16.2) [symbolic = %F.type (constants.%F.type.2aef59.3)]
  361. // CHECK:STDOUT: %I.facet: @TestGeneric.%I.type.loc18_16.2 (%I.type.325e65.3) = facet_value %A.loc17_32.2, (%I.lookup_impl_witness) [symbolic = %I.facet (constants.%I.facet.6d2)]
  362. // CHECK:STDOUT: %.loc18_11: type = fn_type_with_self_type %F.type, %I.facet [symbolic = %.loc18_11 (constants.%.fe1)]
  363. // CHECK:STDOUT: %impl.elem0.loc18_11.2: @TestGeneric.%.loc18_11 (%.fe1) = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_11.2 (constants.%impl.elem0)]
  364. // CHECK:STDOUT: %specific_impl_fn.loc18_11.2: <specific function> = specific_impl_function %impl.elem0.loc18_11.2, @F.1(%W.loc17_16.2, %I.facet) [symbolic = %specific_impl_fn.loc18_11.2 (constants.%specific_impl_fn)]
  365. // CHECK:STDOUT:
  366. // CHECK:STDOUT: fn(%a.param: @TestGeneric.%A.loc17_32.2 (%A.13025a.3)) -> @TestGeneric.%W.loc17_16.2 (%W) {
  367. // CHECK:STDOUT: !entry:
  368. // CHECK:STDOUT: %a.ref: @TestGeneric.%A.loc17_32.2 (%A.13025a.3) = name_ref a, %a
  369. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  370. // CHECK:STDOUT: %W.ref.loc18: type = name_ref W, %W.loc17_16.1 [symbolic = %W.loc17_16.2 (constants.%W)]
  371. // CHECK:STDOUT: %I.type.loc18_16.1: type = facet_type <@I, @I(constants.%W)> [symbolic = %I.type.loc18_16.2 (constants.%I.type.325e65.3)]
  372. // CHECK:STDOUT: %.loc18_17: @TestGeneric.%I.assoc_type (%I.assoc_type.1e5078.3) = specific_constant @I.%assoc0.loc8_26.1, @I(constants.%W) [symbolic = %assoc0 (constants.%assoc0.8f0422.3)]
  373. // CHECK:STDOUT: %F.ref: @TestGeneric.%I.assoc_type (%I.assoc_type.1e5078.3) = name_ref F, %.loc18_17 [symbolic = %assoc0 (constants.%assoc0.8f0422.3)]
  374. // CHECK:STDOUT: %impl.elem0.loc18_11.1: @TestGeneric.%.loc18_11 (%.fe1) = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc18_11.2 (constants.%impl.elem0)]
  375. // CHECK:STDOUT: %bound_method.loc18_11: <bound method> = bound_method %a.ref, %impl.elem0.loc18_11.1
  376. // CHECK:STDOUT: %specific_impl_fn.loc18_11.1: <specific function> = specific_impl_function %impl.elem0.loc18_11.1, @F.1(constants.%W, constants.%I.facet.6d2) [symbolic = %specific_impl_fn.loc18_11.2 (constants.%specific_impl_fn)]
  377. // CHECK:STDOUT: %bound_method.loc18_21: <bound method> = bound_method %a.ref, %specific_impl_fn.loc18_11.1
  378. // CHECK:STDOUT: %.loc18_21: init @TestGeneric.%W.loc17_16.2 (%W) = call %bound_method.loc18_21(%a.ref)
  379. // CHECK:STDOUT: %.loc18_22.1: @TestGeneric.%W.loc17_16.2 (%W) = value_of_initializer %.loc18_21
  380. // CHECK:STDOUT: %.loc18_22.2: @TestGeneric.%W.loc17_16.2 (%W) = converted %.loc18_21, %.loc18_22.1
  381. // CHECK:STDOUT: return %.loc18_22.2
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT: }
  384. // CHECK:STDOUT:
  385. // CHECK:STDOUT: fn @TestSpecific(%a.param: %A.235) -> %empty_struct_type {
  386. // CHECK:STDOUT: !entry:
  387. // CHECK:STDOUT: %a.ref: %A.235 = name_ref a, %a
  388. // CHECK:STDOUT: %I.ref: %I.type.dac = name_ref I, file.%I.decl [concrete = constants.%I.generic]
  389. // CHECK:STDOUT: %.loc22_16: %empty_struct_type = struct_literal ()
  390. // CHECK:STDOUT: %.loc22_17: type = converted %.loc22_16, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
  391. // CHECK:STDOUT: %I.type: type = facet_type <@I, @I(constants.%empty_struct_type)> [concrete = constants.%I.type.885]
  392. // CHECK:STDOUT: %.loc22_18: %I.assoc_type.22c = specific_constant @I.%assoc0.loc8_26.1, @I(constants.%empty_struct_type) [concrete = constants.%assoc0.722]
  393. // CHECK:STDOUT: %F.ref: %I.assoc_type.22c = name_ref F, %.loc22_18 [concrete = constants.%assoc0.722]
  394. // CHECK:STDOUT: %impl.elem0: %.8fd = impl_witness_access constants.%I.impl_witness.0f2, element0 [concrete = constants.%F.158]
  395. // CHECK:STDOUT: %bound_method.loc22_11: <bound method> = bound_method %a.ref, %impl.elem0
  396. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [concrete = constants.%F.specific_fn]
  397. // CHECK:STDOUT: %bound_method.loc22_22.1: <bound method> = bound_method %a.ref, %specific_fn
  398. // CHECK:STDOUT: %F.call: init %empty_struct_type = call %bound_method.loc22_22.1(%a.ref)
  399. // CHECK:STDOUT: %.loc22_22.1: ref %empty_struct_type = temporary_storage
  400. // CHECK:STDOUT: %.loc22_22.2: ref %empty_struct_type = temporary %.loc22_22.1, %F.call
  401. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
  402. // CHECK:STDOUT: %.loc22_23: %empty_struct_type = converted %F.call, %empty_struct [concrete = constants.%empty_struct]
  403. // CHECK:STDOUT: %Op.bound: <bound method> = bound_method %.loc22_22.1, constants.%Op.d5a
  404. // CHECK:STDOUT: %Op.specific_fn: <specific function> = specific_function constants.%Op.d5a, @Op.2(constants.%empty_struct_type) [concrete = constants.%Op.specific_fn]
  405. // CHECK:STDOUT: %bound_method.loc22_22.2: <bound method> = bound_method %.loc22_22.1, %Op.specific_fn
  406. // CHECK:STDOUT: %addr: %ptr.c28 = addr_of %.loc22_22.1
  407. // CHECK:STDOUT: %no_op: init %empty_tuple.type = call %bound_method.loc22_22.2(%addr)
  408. // CHECK:STDOUT: return %.loc22_23
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: specific @A(constants.%T) {
  412. // CHECK:STDOUT: %T.loc3_9.2 => constants.%T
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT:
  415. // CHECK:STDOUT: specific @I(constants.%U) {
  416. // CHECK:STDOUT: %U.loc7_13.2 => constants.%U
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT:
  419. // CHECK:STDOUT: specific @F.1(constants.%U, constants.%Self.209206.1) {
  420. // CHECK:STDOUT: %U => constants.%U
  421. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.1
  422. // CHECK:STDOUT: %Self => constants.%Self.209206.1
  423. // CHECK:STDOUT: %Self.as_type.loc8_14.1 => constants.%Self.as_type.928
  424. // CHECK:STDOUT: %pattern_type.loc8_8 => constants.%pattern_type.4be
  425. // CHECK:STDOUT: %pattern_type.loc8_22 => constants.%pattern_type.7dcd0a.1
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: specific @A(constants.%V) {
  429. // CHECK:STDOUT: %T.loc3_9.2 => constants.%V
  430. // CHECK:STDOUT:
  431. // CHECK:STDOUT: !definition:
  432. // CHECK:STDOUT: %require_complete => constants.%require_complete.4aeca8.2
  433. // CHECK:STDOUT: %A => constants.%A.13025a.2
  434. // CHECK:STDOUT: %A.elem => constants.%A.elem.1ceb36.2
  435. // CHECK:STDOUT: %struct_type.n.loc5_1.2 => constants.%struct_type.n.848971.2
  436. // CHECK:STDOUT: %complete_type.loc5_1.2 => constants.%complete_type.84bb3d.2
  437. // CHECK:STDOUT: }
  438. // CHECK:STDOUT:
  439. // CHECK:STDOUT: specific @I(constants.%V) {
  440. // CHECK:STDOUT: %U.loc7_13.2 => constants.%V
  441. // CHECK:STDOUT:
  442. // CHECK:STDOUT: !definition:
  443. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.2
  444. // CHECK:STDOUT: %Self.2 => constants.%Self.209206.2
  445. // CHECK:STDOUT: %F.type => constants.%F.type.2aef59.2
  446. // CHECK:STDOUT: %F => constants.%F.bb2dd4.2
  447. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.1e5078.2
  448. // CHECK:STDOUT: %assoc0.loc8_26.2 => constants.%assoc0.8f0422.2
  449. // CHECK:STDOUT: }
  450. // CHECK:STDOUT:
  451. // CHECK:STDOUT: specific @impl.27e(constants.%V) {
  452. // CHECK:STDOUT: %V.loc11_14.2 => constants.%V
  453. // CHECK:STDOUT: %A.loc11_27.2 => constants.%A.13025a.2
  454. // CHECK:STDOUT: %I.type.loc11_35.2 => constants.%I.type.325e65.2
  455. // CHECK:STDOUT: %require_complete => constants.%require_complete.cfebb2.1
  456. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.40ab31.1
  457. // CHECK:STDOUT:
  458. // CHECK:STDOUT: !definition:
  459. // CHECK:STDOUT: %F.type => constants.%F.type.0fea45.1
  460. // CHECK:STDOUT: %F => constants.%F.d6ae34.1
  461. // CHECK:STDOUT: }
  462. // CHECK:STDOUT:
  463. // CHECK:STDOUT: specific @F.2(constants.%V) {
  464. // CHECK:STDOUT: %V => constants.%V
  465. // CHECK:STDOUT: %A => constants.%A.13025a.2
  466. // CHECK:STDOUT: %pattern_type.loc12_8 => constants.%pattern_type.68d8d3.1
  467. // CHECK:STDOUT: %pattern_type.loc12_22 => constants.%pattern_type.7dcd0a.2
  468. // CHECK:STDOUT: }
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: specific @F.1(constants.%V, constants.%I.facet.de3) {
  471. // CHECK:STDOUT: %U => constants.%V
  472. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.2
  473. // CHECK:STDOUT: %Self => constants.%I.facet.de3
  474. // CHECK:STDOUT: %Self.as_type.loc8_14.1 => constants.%A.13025a.2
  475. // CHECK:STDOUT: %pattern_type.loc8_8 => constants.%pattern_type.68d8d3.1
  476. // CHECK:STDOUT: %pattern_type.loc8_22 => constants.%pattern_type.7dcd0a.2
  477. // CHECK:STDOUT: }
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: specific @A(constants.%W) {
  480. // CHECK:STDOUT: %T.loc3_9.2 => constants.%W
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: !definition:
  483. // CHECK:STDOUT: %require_complete => constants.%require_complete.4aeca8.3
  484. // CHECK:STDOUT: %A => constants.%A.13025a.3
  485. // CHECK:STDOUT: %A.elem => constants.%A.elem.1ceb36.3
  486. // CHECK:STDOUT: %struct_type.n.loc5_1.2 => constants.%struct_type.n.848971.3
  487. // CHECK:STDOUT: %complete_type.loc5_1.2 => constants.%complete_type.84bb3d.3
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: specific @TestGeneric(constants.%W) {
  491. // CHECK:STDOUT: %W.loc17_16.2 => constants.%W
  492. // CHECK:STDOUT: %A.loc17_32.2 => constants.%A.13025a.3
  493. // CHECK:STDOUT: %pattern_type.loc17_26 => constants.%pattern_type.68d8d3.2
  494. // CHECK:STDOUT: %pattern_type.loc17_35 => constants.%pattern_type.7dcd0a.3
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: specific @I(constants.%W) {
  498. // CHECK:STDOUT: %U.loc7_13.2 => constants.%W
  499. // CHECK:STDOUT:
  500. // CHECK:STDOUT: !definition:
  501. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.3
  502. // CHECK:STDOUT: %Self.2 => constants.%Self.209206.3
  503. // CHECK:STDOUT: %F.type => constants.%F.type.2aef59.3
  504. // CHECK:STDOUT: %F => constants.%F.bb2dd4.3
  505. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.1e5078.3
  506. // CHECK:STDOUT: %assoc0.loc8_26.2 => constants.%assoc0.8f0422.3
  507. // CHECK:STDOUT: }
  508. // CHECK:STDOUT:
  509. // CHECK:STDOUT: specific @impl.27e(constants.%W) {
  510. // CHECK:STDOUT: %V.loc11_14.2 => constants.%W
  511. // CHECK:STDOUT: %A.loc11_27.2 => constants.%A.13025a.3
  512. // CHECK:STDOUT: %I.type.loc11_35.2 => constants.%I.type.325e65.3
  513. // CHECK:STDOUT: %require_complete => constants.%require_complete.cfebb2.2
  514. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.40ab31.2
  515. // CHECK:STDOUT:
  516. // CHECK:STDOUT: !definition:
  517. // CHECK:STDOUT: %F.type => constants.%F.type.0fea45.2
  518. // CHECK:STDOUT: %F => constants.%F.d6ae34.2
  519. // CHECK:STDOUT: }
  520. // CHECK:STDOUT:
  521. // CHECK:STDOUT: specific @F.1(constants.%W, constants.%I.facet.6d2) {
  522. // CHECK:STDOUT: %U => constants.%W
  523. // CHECK:STDOUT: %I.type => constants.%I.type.325e65.3
  524. // CHECK:STDOUT: %Self => constants.%I.facet.6d2
  525. // CHECK:STDOUT: %Self.as_type.loc8_14.1 => constants.%A.13025a.3
  526. // CHECK:STDOUT: %pattern_type.loc8_8 => constants.%pattern_type.68d8d3.2
  527. // CHECK:STDOUT: %pattern_type.loc8_22 => constants.%pattern_type.7dcd0a.3
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: specific @A(constants.%empty_struct_type) {
  531. // CHECK:STDOUT: %T.loc3_9.2 => constants.%empty_struct_type
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: !definition:
  534. // CHECK:STDOUT: %require_complete => constants.%complete_type.357
  535. // CHECK:STDOUT: %A => constants.%A.235
  536. // CHECK:STDOUT: %A.elem => constants.%A.elem.2af
  537. // CHECK:STDOUT: %struct_type.n.loc5_1.2 => constants.%struct_type.n.91c
  538. // CHECK:STDOUT: %complete_type.loc5_1.2 => constants.%complete_type.0a6
  539. // CHECK:STDOUT: }
  540. // CHECK:STDOUT:
  541. // CHECK:STDOUT: specific @I(constants.%empty_struct_type) {
  542. // CHECK:STDOUT: %U.loc7_13.2 => constants.%empty_struct_type
  543. // CHECK:STDOUT:
  544. // CHECK:STDOUT: !definition:
  545. // CHECK:STDOUT: %I.type => constants.%I.type.885
  546. // CHECK:STDOUT: %Self.2 => constants.%Self.4e2
  547. // CHECK:STDOUT: %F.type => constants.%F.type.684
  548. // CHECK:STDOUT: %F => constants.%F.a8d
  549. // CHECK:STDOUT: %I.assoc_type => constants.%I.assoc_type.22c
  550. // CHECK:STDOUT: %assoc0.loc8_26.2 => constants.%assoc0.722
  551. // CHECK:STDOUT: }
  552. // CHECK:STDOUT:
  553. // CHECK:STDOUT: specific @impl.27e(constants.%empty_struct_type) {
  554. // CHECK:STDOUT: %V.loc11_14.2 => constants.%empty_struct_type
  555. // CHECK:STDOUT: %A.loc11_27.2 => constants.%A.235
  556. // CHECK:STDOUT: %I.type.loc11_35.2 => constants.%I.type.885
  557. // CHECK:STDOUT: %require_complete => constants.%complete_type.788
  558. // CHECK:STDOUT: %I.impl_witness => constants.%I.impl_witness.0f2
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: !definition:
  561. // CHECK:STDOUT: %F.type => constants.%F.type.875
  562. // CHECK:STDOUT: %F => constants.%F.158
  563. // CHECK:STDOUT: }
  564. // CHECK:STDOUT:
  565. // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) {
  566. // CHECK:STDOUT: %V => constants.%empty_struct_type
  567. // CHECK:STDOUT: %A => constants.%A.235
  568. // CHECK:STDOUT: %pattern_type.loc12_8 => constants.%pattern_type.496
  569. // CHECK:STDOUT: %pattern_type.loc12_22 => constants.%pattern_type.a96
  570. // CHECK:STDOUT:
  571. // CHECK:STDOUT: !definition:
  572. // CHECK:STDOUT: %require_complete.loc12_22 => constants.%complete_type.357
  573. // CHECK:STDOUT: %require_complete.loc12_12 => constants.%complete_type.0a6
  574. // CHECK:STDOUT: %A.elem => constants.%A.elem.2af
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT: