dot_self_index.carbon 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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/where_expr/dot_self_index.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/where_expr/dot_self_index.carbon
  10. interface Empty(W:! type) {
  11. let A:! type;
  12. }
  13. // T has index 0
  14. // .Self has index invalid, not 1
  15. // V has index 1, does not match .Self
  16. fn H(T:! type, U: Empty(T) where .A = T*, V:! type) {}
  17. fn G(U: Empty(i32) where .A = i32*) {
  18. H(i32, U, bool);
  19. }
  20. // CHECK:STDOUT: --- dot_self_index.carbon
  21. // CHECK:STDOUT:
  22. // CHECK:STDOUT: constants {
  23. // CHECK:STDOUT: %W: type = bind_symbolic_name W, 0 [symbolic]
  24. // CHECK:STDOUT: %W.patt: type = symbolic_binding_pattern W, 0 [symbolic]
  25. // CHECK:STDOUT: %Empty.type.d5a: type = generic_interface_type @Empty [template]
  26. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  27. // CHECK:STDOUT: %Empty.generic: %Empty.type.d5a = struct_value () [template]
  28. // CHECK:STDOUT: %Empty.type.3e5fde.1: type = facet_type <@Empty, @Empty(%W)> [symbolic]
  29. // CHECK:STDOUT: %Self: %Empty.type.3e5fde.1 = bind_symbolic_name Self, 1 [symbolic]
  30. // CHECK:STDOUT: %Empty.assoc_type.54c14f.1: type = assoc_entity_type %Empty.type.3e5fde.1 [symbolic]
  31. // CHECK:STDOUT: %assoc0.68f673.1: %Empty.assoc_type.54c14f.1 = assoc_entity element0, @Empty.%A [symbolic]
  32. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  33. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  34. // CHECK:STDOUT: %Empty.type.3e5fde.2: type = facet_type <@Empty, @Empty(%T)> [symbolic]
  35. // CHECK:STDOUT: %.Self.c95: %Empty.type.3e5fde.2 = bind_symbolic_name .Self [symbolic]
  36. // CHECK:STDOUT: %require_complete.22f: <witness> = require_complete_type %Empty.type.3e5fde.2 [symbolic]
  37. // CHECK:STDOUT: %Empty.assoc_type.54c14f.2: type = assoc_entity_type %Empty.type.3e5fde.2 [symbolic]
  38. // CHECK:STDOUT: %assoc0.68f673.2: %Empty.assoc_type.54c14f.2 = assoc_entity element0, @Empty.%A [symbolic]
  39. // CHECK:STDOUT: %.Self.as_type.a75: type = facet_access_type %.Self.c95 [symbolic]
  40. // CHECK:STDOUT: %.Self.as_wit.da4: <witness> = facet_access_witness %.Self.c95 [symbolic]
  41. // CHECK:STDOUT: %Empty.facet.bea: %Empty.type.3e5fde.2 = facet_value %.Self.as_type.a75, %.Self.as_wit.da4 [symbolic]
  42. // CHECK:STDOUT: %impl.elem0.41c: type = impl_witness_access %.Self.as_wit.da4, element0 [symbolic]
  43. // CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic]
  44. // CHECK:STDOUT: %Empty_where.type.4ed: type = facet_type <@Empty, @Empty(%T) where %impl.elem0.41c = %ptr.79f> [symbolic]
  45. // CHECK:STDOUT: %V: type = bind_symbolic_name V, 1 [symbolic]
  46. // CHECK:STDOUT: %V.patt: type = symbolic_binding_pattern V, 1 [symbolic]
  47. // CHECK:STDOUT: %H.type: type = fn_type @H [template]
  48. // CHECK:STDOUT: %H: %H.type = struct_value () [template]
  49. // CHECK:STDOUT: %require_complete.510: <witness> = require_complete_type %Empty_where.type.4ed [symbolic]
  50. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  51. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  52. // CHECK:STDOUT: %Empty.type.f0b: type = facet_type <@Empty, @Empty(%i32)> [template]
  53. // CHECK:STDOUT: %.Self.e6e: %Empty.type.f0b = bind_symbolic_name .Self [symbolic]
  54. // CHECK:STDOUT: %Empty.assoc_type.a46: type = assoc_entity_type %Empty.type.f0b [template]
  55. // CHECK:STDOUT: %assoc0.0c3: %Empty.assoc_type.a46 = assoc_entity element0, @Empty.%A [template]
  56. // CHECK:STDOUT: %.Self.as_type.920: type = facet_access_type %.Self.e6e [symbolic]
  57. // CHECK:STDOUT: %.Self.as_wit.581: <witness> = facet_access_witness %.Self.e6e [symbolic]
  58. // CHECK:STDOUT: %Empty.facet.933: %Empty.type.f0b = facet_value %.Self.as_type.920, %.Self.as_wit.581 [symbolic]
  59. // CHECK:STDOUT: %impl.elem0.797: type = impl_witness_access %.Self.as_wit.581, element0 [symbolic]
  60. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template]
  61. // CHECK:STDOUT: %Empty_where.type.a58: type = facet_type <@Empty, @Empty(%i32) where %impl.elem0.797 = %ptr.235> [template]
  62. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  63. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  64. // CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template]
  65. // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
  66. // CHECK:STDOUT: %complete_type.091: <witness> = complete_type_witness %Empty.type.f0b [template]
  67. // CHECK:STDOUT: %H.specific_fn: <specific function> = specific_function %H, @H(%i32, bool) [template]
  68. // CHECK:STDOUT: %complete_type.5e7: <witness> = complete_type_witness %Empty_where.type.a58 [template]
  69. // CHECK:STDOUT: }
  70. // CHECK:STDOUT:
  71. // CHECK:STDOUT: imports {
  72. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  73. // CHECK:STDOUT: .Int = %Core.Int
  74. // CHECK:STDOUT: .Bool = %Core.Bool
  75. // CHECK:STDOUT: import Core//prelude
  76. // CHECK:STDOUT: import Core//prelude/...
  77. // CHECK:STDOUT: }
  78. // CHECK:STDOUT: }
  79. // CHECK:STDOUT:
  80. // CHECK:STDOUT: file {
  81. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  82. // CHECK:STDOUT: .Core = imports.%Core
  83. // CHECK:STDOUT: .Empty = %Empty.decl
  84. // CHECK:STDOUT: .H = %H.decl
  85. // CHECK:STDOUT: .G = %G.decl
  86. // CHECK:STDOUT: }
  87. // CHECK:STDOUT: %Core.import = import Core
  88. // CHECK:STDOUT: %Empty.decl: %Empty.type.d5a = interface_decl @Empty [template = constants.%Empty.generic] {
  89. // CHECK:STDOUT: %W.patt.loc11_17.1: type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_17.2 (constants.%W.patt)]
  90. // CHECK:STDOUT: %W.param_patt: type = value_param_pattern %W.patt.loc11_17.1, runtime_param<none> [symbolic = %W.patt.loc11_17.2 (constants.%W.patt)]
  91. // CHECK:STDOUT: } {
  92. // CHECK:STDOUT: %W.param: type = value_param runtime_param<none>
  93. // CHECK:STDOUT: %W.loc11_17.1: type = bind_symbolic_name W, 0, %W.param [symbolic = %W.loc11_17.2 (constants.%W)]
  94. // CHECK:STDOUT: }
  95. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {
  96. // CHECK:STDOUT: %T.patt.loc18_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_6.2 (constants.%T.patt)]
  97. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc18_6.1, runtime_param<none> [symbolic = %T.patt.loc18_6.2 (constants.%T.patt)]
  98. // CHECK:STDOUT: %U.patt: @H.%Empty_where.type (%Empty_where.type.4ed) = binding_pattern U
  99. // CHECK:STDOUT: %U.param_patt: @H.%Empty_where.type (%Empty_where.type.4ed) = value_param_pattern %U.patt, runtime_param0
  100. // CHECK:STDOUT: %V.patt.loc18_43.1: type = symbolic_binding_pattern V, 1 [symbolic = %V.patt.loc18_43.2 (constants.%V.patt)]
  101. // CHECK:STDOUT: %V.param_patt: type = value_param_pattern %V.patt.loc18_43.1, runtime_param<none> [symbolic = %V.patt.loc18_43.2 (constants.%V.patt)]
  102. // CHECK:STDOUT: } {
  103. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  104. // CHECK:STDOUT: %T.loc18_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc18_6.2 (constants.%T)]
  105. // CHECK:STDOUT: %U.param: @H.%Empty_where.type (%Empty_where.type.4ed) = value_param runtime_param0
  106. // CHECK:STDOUT: %.loc18_28.1: type = splice_block %.loc18_28.2 [symbolic = %Empty_where.type (constants.%Empty_where.type.4ed)] {
  107. // CHECK:STDOUT: %Empty.ref: %Empty.type.d5a = name_ref Empty, file.%Empty.decl [template = constants.%Empty.generic]
  108. // CHECK:STDOUT: %T.ref.loc18_25: type = name_ref T, %T.loc18_6.1 [symbolic = %T.loc18_6.2 (constants.%T)]
  109. // CHECK:STDOUT: %Empty.type.loc18_26.1: type = facet_type <@Empty, @Empty(constants.%T)> [symbolic = %Empty.type.loc18_26.2 (constants.%Empty.type.3e5fde.2)]
  110. // CHECK:STDOUT: %.Self.1: @H.%Empty.type.loc18_26.2 (%Empty.type.3e5fde.2) = bind_symbolic_name .Self [symbolic = %.Self.2 (constants.%.Self.c95)]
  111. // CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc18_26.2 (%Empty.type.3e5fde.2) = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.c95)]
  112. // CHECK:STDOUT: %.loc18_34.1: @H.%Empty.assoc_type (%Empty.assoc_type.54c14f.2) = specific_constant @A.%assoc0, @Empty(constants.%T) [symbolic = %assoc0 (constants.%assoc0.68f673.2)]
  113. // CHECK:STDOUT: %A.ref: @H.%Empty.assoc_type (%Empty.assoc_type.54c14f.2) = name_ref A, %.loc18_34.1 [symbolic = %assoc0 (constants.%assoc0.68f673.2)]
  114. // CHECK:STDOUT: %.Self.as_type.loc18_34.1: type = facet_access_type %.Self.ref [symbolic = %.Self.as_type.loc18_34.2 (constants.%.Self.as_type.a75)]
  115. // CHECK:STDOUT: %.loc18_34.2: type = converted %.Self.ref, %.Self.as_type.loc18_34.1 [symbolic = %.Self.as_type.loc18_34.2 (constants.%.Self.as_type.a75)]
  116. // CHECK:STDOUT: %.Self.as_wit.loc18_34.1: <witness> = facet_access_witness %.Self.ref [symbolic = %.Self.as_wit.loc18_34.2 (constants.%.Self.as_wit.da4)]
  117. // CHECK:STDOUT: %impl.elem0.loc18_34.1: type = impl_witness_access %.Self.as_wit.loc18_34.1, element0 [symbolic = %impl.elem0.loc18_34.2 (constants.%impl.elem0.41c)]
  118. // CHECK:STDOUT: %T.ref.loc18_39: type = name_ref T, %T.loc18_6.1 [symbolic = %T.loc18_6.2 (constants.%T)]
  119. // CHECK:STDOUT: %ptr.loc18_40.1: type = ptr_type %T [symbolic = %ptr.loc18_40.2 (constants.%ptr.79f)]
  120. // CHECK:STDOUT: %.loc18_28.2: type = where_expr %.Self.1 [symbolic = %Empty_where.type (constants.%Empty_where.type.4ed)] {
  121. // CHECK:STDOUT: requirement_rewrite %impl.elem0.loc18_34.1, %ptr.loc18_40.1
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: %U: @H.%Empty_where.type (%Empty_where.type.4ed) = bind_name U, %U.param
  125. // CHECK:STDOUT: %V.param: type = value_param runtime_param<none>
  126. // CHECK:STDOUT: %V.loc18_43.1: type = bind_symbolic_name V, 1, %V.param [symbolic = %V.loc18_43.2 (constants.%V)]
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  129. // CHECK:STDOUT: %U.patt: %Empty_where.type.a58 = binding_pattern U
  130. // CHECK:STDOUT: %U.param_patt: %Empty_where.type.a58 = value_param_pattern %U.patt, runtime_param0
  131. // CHECK:STDOUT: } {
  132. // CHECK:STDOUT: %U.param: %Empty_where.type.a58 = value_param runtime_param0
  133. // CHECK:STDOUT: %.loc20_20.1: type = splice_block %.loc20_20.2 [template = constants.%Empty_where.type.a58] {
  134. // CHECK:STDOUT: %Empty.ref: %Empty.type.d5a = name_ref Empty, file.%Empty.decl [template = constants.%Empty.generic]
  135. // CHECK:STDOUT: %int_32.loc20_15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  136. // CHECK:STDOUT: %i32.loc20_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  137. // CHECK:STDOUT: %Empty.type: type = facet_type <@Empty, @Empty(constants.%i32)> [template = constants.%Empty.type.f0b]
  138. // CHECK:STDOUT: %.Self: %Empty.type.f0b = bind_symbolic_name .Self [symbolic = constants.%.Self.e6e]
  139. // CHECK:STDOUT: %.Self.ref: %Empty.type.f0b = name_ref .Self, %.Self [symbolic = constants.%.Self.e6e]
  140. // CHECK:STDOUT: %.loc20_26.1: %Empty.assoc_type.a46 = specific_constant @A.%assoc0, @Empty(constants.%i32) [template = constants.%assoc0.0c3]
  141. // CHECK:STDOUT: %A.ref: %Empty.assoc_type.a46 = name_ref A, %.loc20_26.1 [template = constants.%assoc0.0c3]
  142. // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = constants.%.Self.as_type.920]
  143. // CHECK:STDOUT: %.loc20_26.2: type = converted %.Self.ref, %.Self.as_type [symbolic = constants.%.Self.as_type.920]
  144. // CHECK:STDOUT: %.Self.as_wit: <witness> = facet_access_witness %.Self.ref [symbolic = constants.%.Self.as_wit.581]
  145. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %.Self.as_wit, element0 [symbolic = constants.%impl.elem0.797]
  146. // CHECK:STDOUT: %int_32.loc20_31: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  147. // CHECK:STDOUT: %i32.loc20_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  148. // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.235]
  149. // CHECK:STDOUT: %.loc20_20.2: type = where_expr %.Self [template = constants.%Empty_where.type.a58] {
  150. // CHECK:STDOUT: requirement_rewrite %impl.elem0, %ptr
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT: }
  153. // CHECK:STDOUT: %U: %Empty_where.type.a58 = bind_name U, %U.param
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT:
  157. // CHECK:STDOUT: generic interface @Empty(%W.loc11_17.1: type) {
  158. // CHECK:STDOUT: %W.loc11_17.2: type = bind_symbolic_name W, 0 [symbolic = %W.loc11_17.2 (constants.%W)]
  159. // CHECK:STDOUT: %W.patt.loc11_17.2: type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc11_17.2 (constants.%W.patt)]
  160. // CHECK:STDOUT:
  161. // CHECK:STDOUT: !definition:
  162. // CHECK:STDOUT: %Empty.type: type = facet_type <@Empty, @Empty(%W.loc11_17.2)> [symbolic = %Empty.type (constants.%Empty.type.3e5fde.1)]
  163. // CHECK:STDOUT: %Self.2: %Empty.type.3e5fde.1 = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  164. // CHECK:STDOUT: %Empty.assoc_type: type = assoc_entity_type @Empty.%Empty.type (%Empty.type.3e5fde.1) [symbolic = %Empty.assoc_type (constants.%Empty.assoc_type.54c14f.1)]
  165. // CHECK:STDOUT: %assoc0: @Empty.%Empty.assoc_type (%Empty.assoc_type.54c14f.1) = assoc_entity element0, %A [symbolic = %assoc0 (constants.%assoc0.68f673.1)]
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: interface {
  168. // CHECK:STDOUT: %Self.1: @Empty.%Empty.type (%Empty.type.3e5fde.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)]
  169. // CHECK:STDOUT: %A: type = assoc_const_decl @A [template] {
  170. // CHECK:STDOUT: %assoc0: @Empty.%Empty.assoc_type (%Empty.assoc_type.54c14f.1) = assoc_entity element0, @Empty.%A [symbolic = @Empty.%assoc0 (constants.%assoc0.68f673.1)]
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT:
  173. // CHECK:STDOUT: !members:
  174. // CHECK:STDOUT: .Self = %Self.1
  175. // CHECK:STDOUT: .A = @A.%assoc0
  176. // CHECK:STDOUT: witness = (%A)
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT:
  180. // CHECK:STDOUT: generic assoc_const @A(@Empty.%W.loc11_17.1: type, @Empty.%Self.1: @Empty.%Empty.type (%Empty.type.3e5fde.1)) {
  181. // CHECK:STDOUT: assoc_const A:! type;
  182. // CHECK:STDOUT: }
  183. // CHECK:STDOUT:
  184. // CHECK:STDOUT: generic fn @H(%T.loc18_6.1: type, %V.loc18_43.1: type) {
  185. // CHECK:STDOUT: %T.loc18_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc18_6.2 (constants.%T)]
  186. // CHECK:STDOUT: %T.patt.loc18_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc18_6.2 (constants.%T.patt)]
  187. // CHECK:STDOUT: %Empty.type.loc18_26.2: type = facet_type <@Empty, @Empty(%T.loc18_6.2)> [symbolic = %Empty.type.loc18_26.2 (constants.%Empty.type.3e5fde.2)]
  188. // CHECK:STDOUT: %.Self.2: @H.%Empty.type.loc18_26.2 (%Empty.type.3e5fde.2) = bind_symbolic_name .Self [symbolic = %.Self.2 (constants.%.Self.c95)]
  189. // CHECK:STDOUT: %require_complete.loc18_34: <witness> = require_complete_type @H.%Empty.type.loc18_26.2 (%Empty.type.3e5fde.2) [symbolic = %require_complete.loc18_34 (constants.%require_complete.22f)]
  190. // CHECK:STDOUT: %Empty.assoc_type: type = assoc_entity_type @H.%Empty.type.loc18_26.2 (%Empty.type.3e5fde.2) [symbolic = %Empty.assoc_type (constants.%Empty.assoc_type.54c14f.2)]
  191. // CHECK:STDOUT: %assoc0: @H.%Empty.assoc_type (%Empty.assoc_type.54c14f.2) = assoc_entity element0, @Empty.%A [symbolic = %assoc0 (constants.%assoc0.68f673.2)]
  192. // CHECK:STDOUT: %.Self.as_type.loc18_34.2: type = facet_access_type %.Self.2 [symbolic = %.Self.as_type.loc18_34.2 (constants.%.Self.as_type.a75)]
  193. // CHECK:STDOUT: %.Self.as_wit.loc18_34.2: <witness> = facet_access_witness %.Self.2 [symbolic = %.Self.as_wit.loc18_34.2 (constants.%.Self.as_wit.da4)]
  194. // CHECK:STDOUT: %impl.elem0.loc18_34.2: type = impl_witness_access %.Self.as_wit.loc18_34.2, element0 [symbolic = %impl.elem0.loc18_34.2 (constants.%impl.elem0.41c)]
  195. // CHECK:STDOUT: %ptr.loc18_40.2: type = ptr_type @H.%T.loc18_6.2 (%T) [symbolic = %ptr.loc18_40.2 (constants.%ptr.79f)]
  196. // CHECK:STDOUT: %Empty_where.type: type = facet_type <@Empty, @Empty(%T.loc18_6.2) where %impl.elem0.loc18_34.2 (constants.%impl.elem0.41c) = %ptr.loc18_40.2 (constants.%ptr.79f)> [symbolic = %Empty_where.type (constants.%Empty_where.type.4ed)]
  197. // CHECK:STDOUT: %V.loc18_43.2: type = bind_symbolic_name V, 1 [symbolic = %V.loc18_43.2 (constants.%V)]
  198. // CHECK:STDOUT: %V.patt.loc18_43.2: type = symbolic_binding_pattern V, 1 [symbolic = %V.patt.loc18_43.2 (constants.%V.patt)]
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: !definition:
  201. // CHECK:STDOUT: %require_complete.loc18_17: <witness> = require_complete_type @H.%Empty_where.type (%Empty_where.type.4ed) [symbolic = %require_complete.loc18_17 (constants.%require_complete.510)]
  202. // CHECK:STDOUT:
  203. // CHECK:STDOUT: fn(%T.param_patt: type, %U.param_patt: @H.%Empty_where.type (%Empty_where.type.4ed), %V.param_patt: type) {
  204. // CHECK:STDOUT: !entry:
  205. // CHECK:STDOUT: return
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: fn @G(%U.param_patt: %Empty_where.type.a58) {
  210. // CHECK:STDOUT: !entry:
  211. // CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [template = constants.%H]
  212. // CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  213. // CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  214. // CHECK:STDOUT: %U.ref: %Empty_where.type.a58 = name_ref U, %U
  215. // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
  216. // CHECK:STDOUT: %.loc21_17.1: type = value_of_initializer %bool.make_type [template = bool]
  217. // CHECK:STDOUT: %.loc21_17.2: type = converted %bool.make_type, %.loc21_17.1 [template = bool]
  218. // CHECK:STDOUT: %H.specific_fn: <specific function> = specific_function %H.ref, @H(constants.%i32, bool) [template = constants.%H.specific_fn]
  219. // CHECK:STDOUT: %H.call: init %empty_tuple.type = call %H.specific_fn(%U.ref)
  220. // CHECK:STDOUT: return
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT:
  223. // CHECK:STDOUT: specific @Empty(constants.%W) {
  224. // CHECK:STDOUT: %W.loc11_17.2 => constants.%W
  225. // CHECK:STDOUT: %W.patt.loc11_17.2 => constants.%W
  226. // CHECK:STDOUT: }
  227. // CHECK:STDOUT:
  228. // CHECK:STDOUT: specific @A(constants.%W, constants.%Self) {}
  229. // CHECK:STDOUT:
  230. // CHECK:STDOUT: specific @Empty(%W.loc11_17.2) {}
  231. // CHECK:STDOUT:
  232. // CHECK:STDOUT: specific @Empty(constants.%T) {
  233. // CHECK:STDOUT: %W.loc11_17.2 => constants.%T
  234. // CHECK:STDOUT: %W.patt.loc11_17.2 => constants.%T
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: !definition:
  237. // CHECK:STDOUT: %Empty.type => constants.%Empty.type.3e5fde.2
  238. // CHECK:STDOUT: %Self.2 => constants.%Self
  239. // CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.54c14f.2
  240. // CHECK:STDOUT: %assoc0 => constants.%assoc0.68f673.2
  241. // CHECK:STDOUT: }
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: specific @A(constants.%T, constants.%Empty.facet.bea) {}
  244. // CHECK:STDOUT:
  245. // CHECK:STDOUT: specific @H(constants.%T, constants.%V) {
  246. // CHECK:STDOUT: %T.loc18_6.2 => constants.%T
  247. // CHECK:STDOUT: %T.patt.loc18_6.2 => constants.%T
  248. // CHECK:STDOUT: %Empty.type.loc18_26.2 => constants.%Empty.type.3e5fde.2
  249. // CHECK:STDOUT: %.Self.2 => constants.%.Self.c95
  250. // CHECK:STDOUT: %require_complete.loc18_34 => constants.%require_complete.22f
  251. // CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.54c14f.2
  252. // CHECK:STDOUT: %assoc0 => constants.%assoc0.68f673.2
  253. // CHECK:STDOUT: %.Self.as_type.loc18_34.2 => constants.%.Self.as_type.a75
  254. // CHECK:STDOUT: %.Self.as_wit.loc18_34.2 => constants.%.Self.as_wit.da4
  255. // CHECK:STDOUT: %impl.elem0.loc18_34.2 => constants.%impl.elem0.41c
  256. // CHECK:STDOUT: %ptr.loc18_40.2 => constants.%ptr.79f
  257. // CHECK:STDOUT: %Empty_where.type => constants.%Empty_where.type.4ed
  258. // CHECK:STDOUT: %V.loc18_43.2 => constants.%V
  259. // CHECK:STDOUT: %V.patt.loc18_43.2 => constants.%V
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: specific @Empty(@H.%T.loc18_6.2) {}
  263. // CHECK:STDOUT:
  264. // CHECK:STDOUT: specific @Empty(constants.%i32) {
  265. // CHECK:STDOUT: %W.loc11_17.2 => constants.%i32
  266. // CHECK:STDOUT: %W.patt.loc11_17.2 => constants.%i32
  267. // CHECK:STDOUT:
  268. // CHECK:STDOUT: !definition:
  269. // CHECK:STDOUT: %Empty.type => constants.%Empty.type.f0b
  270. // CHECK:STDOUT: %Self.2 => constants.%Self
  271. // CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.a46
  272. // CHECK:STDOUT: %assoc0 => constants.%assoc0.0c3
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: specific @A(constants.%i32, constants.%Empty.facet.933) {}
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: specific @H(constants.%i32, bool) {
  278. // CHECK:STDOUT: %T.loc18_6.2 => constants.%i32
  279. // CHECK:STDOUT: %T.patt.loc18_6.2 => constants.%i32
  280. // CHECK:STDOUT: %Empty.type.loc18_26.2 => constants.%Empty.type.f0b
  281. // CHECK:STDOUT: %.Self.2 => constants.%.Self.e6e
  282. // CHECK:STDOUT: %require_complete.loc18_34 => constants.%complete_type.091
  283. // CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.a46
  284. // CHECK:STDOUT: %assoc0 => constants.%assoc0.0c3
  285. // CHECK:STDOUT: %.Self.as_type.loc18_34.2 => constants.%.Self.as_type.920
  286. // CHECK:STDOUT: %.Self.as_wit.loc18_34.2 => constants.%.Self.as_wit.581
  287. // CHECK:STDOUT: %impl.elem0.loc18_34.2 => constants.%impl.elem0.797
  288. // CHECK:STDOUT: %ptr.loc18_40.2 => constants.%ptr.235
  289. // CHECK:STDOUT: %Empty_where.type => constants.%Empty_where.type.a58
  290. // CHECK:STDOUT: %V.loc18_43.2 => bool
  291. // CHECK:STDOUT: %V.patt.loc18_43.2 => bool
  292. // CHECK:STDOUT:
  293. // CHECK:STDOUT: !definition:
  294. // CHECK:STDOUT: %require_complete.loc18_17 => constants.%complete_type.5e7
  295. // CHECK:STDOUT: }
  296. // CHECK:STDOUT: