convert_facet_value_value_to_itself.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  7. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/convert.carbon
  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/facet/convert_facet_value_value_to_itself.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/facet/convert_facet_value_value_to_itself.carbon
  14. interface Animal {}
  15. fn FeedAnimal[T:! Animal](a: T) {}
  16. fn HandleAnimal[T:! Animal](a: T) { FeedAnimal(a); }
  17. class Goat {}
  18. impl Goat as Animal {}
  19. fn F() {
  20. HandleAnimal({} as Goat);
  21. }
  22. // CHECK:STDOUT: --- convert_facet_value_value_to_itself.carbon
  23. // CHECK:STDOUT:
  24. // CHECK:STDOUT: constants {
  25. // CHECK:STDOUT: %Animal.type: type = facet_type <@Animal> [concrete]
  26. // CHECK:STDOUT: %Self.611: %Animal.type = bind_symbolic_name Self, 0 [symbolic]
  27. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  28. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  29. // CHECK:STDOUT: %T: %Animal.type = bind_symbolic_name T, 0 [symbolic]
  30. // CHECK:STDOUT: %pattern_type.3c3: type = pattern_type %Animal.type [concrete]
  31. // CHECK:STDOUT: %T.as_type: type = facet_access_type %T [symbolic]
  32. // CHECK:STDOUT: %pattern_type.29d: type = pattern_type %T.as_type [symbolic]
  33. // CHECK:STDOUT: %FeedAnimal.type: type = fn_type @FeedAnimal [concrete]
  34. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  35. // CHECK:STDOUT: %FeedAnimal: %FeedAnimal.type = struct_value () [concrete]
  36. // CHECK:STDOUT: %require_complete.210: <witness> = require_complete_type %T.as_type [symbolic]
  37. // CHECK:STDOUT: %HandleAnimal.type: type = fn_type @HandleAnimal [concrete]
  38. // CHECK:STDOUT: %HandleAnimal: %HandleAnimal.type = struct_value () [concrete]
  39. // CHECK:STDOUT: %FeedAnimal.specific_fn.a33: <specific function> = specific_function %FeedAnimal, @FeedAnimal(%T) [symbolic]
  40. // CHECK:STDOUT: %Goat: type = class_type @Goat [concrete]
  41. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  42. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  43. // CHECK:STDOUT: %Destroy.impl_witness.06d: <witness> = impl_witness @Goat.%Destroy.impl_witness_table [concrete]
  44. // CHECK:STDOUT: %ptr.940: type = ptr_type %Goat [concrete]
  45. // CHECK:STDOUT: %pattern_type.396: type = pattern_type %ptr.940 [concrete]
  46. // CHECK:STDOUT: %Goat.as.Destroy.impl.Op.type: type = fn_type @Goat.as.Destroy.impl.Op [concrete]
  47. // CHECK:STDOUT: %Goat.as.Destroy.impl.Op: %Goat.as.Destroy.impl.Op.type = struct_value () [concrete]
  48. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  49. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  50. // CHECK:STDOUT: %Animal.impl_witness: <witness> = impl_witness file.%Animal.impl_witness_table [concrete]
  51. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  52. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  53. // CHECK:STDOUT: %Goat.val: %Goat = struct_value () [concrete]
  54. // CHECK:STDOUT: %Animal.facet: %Animal.type = facet_value %Goat, (%Animal.impl_witness) [concrete]
  55. // CHECK:STDOUT: %pattern_type.ab7: type = pattern_type %Goat [concrete]
  56. // CHECK:STDOUT: %HandleAnimal.specific_fn: <specific function> = specific_function %HandleAnimal, @HandleAnimal(%Animal.facet) [concrete]
  57. // CHECK:STDOUT: %FeedAnimal.specific_fn.2ba: <specific function> = specific_function %FeedAnimal, @FeedAnimal(%Animal.facet) [concrete]
  58. // CHECK:STDOUT: }
  59. // CHECK:STDOUT:
  60. // CHECK:STDOUT: imports {
  61. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  62. // CHECK:STDOUT: .Destroy = %Core.Destroy
  63. // CHECK:STDOUT: import Core//prelude
  64. // CHECK:STDOUT: import Core//prelude/...
  65. // CHECK:STDOUT: }
  66. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  67. // CHECK:STDOUT: }
  68. // CHECK:STDOUT:
  69. // CHECK:STDOUT: file {
  70. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  71. // CHECK:STDOUT: .Core = imports.%Core
  72. // CHECK:STDOUT: .Animal = %Animal.decl
  73. // CHECK:STDOUT: .FeedAnimal = %FeedAnimal.decl
  74. // CHECK:STDOUT: .HandleAnimal = %HandleAnimal.decl
  75. // CHECK:STDOUT: .Goat = %Goat.decl
  76. // CHECK:STDOUT: .F = %F.decl
  77. // CHECK:STDOUT: }
  78. // CHECK:STDOUT: %Core.import = import Core
  79. // CHECK:STDOUT: %Animal.decl: type = interface_decl @Animal [concrete = constants.%Animal.type] {} {}
  80. // CHECK:STDOUT: %FeedAnimal.decl: %FeedAnimal.type = fn_decl @FeedAnimal [concrete = constants.%FeedAnimal] {
  81. // CHECK:STDOUT: %T.patt: %pattern_type.3c3 = symbolic_binding_pattern T, 0 [concrete]
  82. // CHECK:STDOUT: %a.patt: @FeedAnimal.%pattern_type (%pattern_type.29d) = binding_pattern a [concrete]
  83. // CHECK:STDOUT: %a.param_patt: @FeedAnimal.%pattern_type (%pattern_type.29d) = value_param_pattern %a.patt, call_param0 [concrete]
  84. // CHECK:STDOUT: } {
  85. // CHECK:STDOUT: %.loc17_19: type = splice_block %Animal.ref [concrete = constants.%Animal.type] {
  86. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  87. // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type]
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT: %T.loc17_15.2: %Animal.type = bind_symbolic_name T, 0 [symbolic = %T.loc17_15.1 (constants.%T)]
  90. // CHECK:STDOUT: %a.param: @FeedAnimal.%T.as_type.loc17_30.1 (%T.as_type) = value_param call_param0
  91. // CHECK:STDOUT: %.loc17_30.1: type = splice_block %.loc17_30.2 [symbolic = %T.as_type.loc17_30.1 (constants.%T.as_type)] {
  92. // CHECK:STDOUT: %T.ref: %Animal.type = name_ref T, %T.loc17_15.2 [symbolic = %T.loc17_15.1 (constants.%T)]
  93. // CHECK:STDOUT: %T.as_type.loc17_30.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc17_30.1 (constants.%T.as_type)]
  94. // CHECK:STDOUT: %.loc17_30.2: type = converted %T.ref, %T.as_type.loc17_30.2 [symbolic = %T.as_type.loc17_30.1 (constants.%T.as_type)]
  95. // CHECK:STDOUT: }
  96. // CHECK:STDOUT: %a: @FeedAnimal.%T.as_type.loc17_30.1 (%T.as_type) = bind_name a, %a.param
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT: %HandleAnimal.decl: %HandleAnimal.type = fn_decl @HandleAnimal [concrete = constants.%HandleAnimal] {
  99. // CHECK:STDOUT: %T.patt: %pattern_type.3c3 = symbolic_binding_pattern T, 0 [concrete]
  100. // CHECK:STDOUT: %a.patt: @HandleAnimal.%pattern_type (%pattern_type.29d) = binding_pattern a [concrete]
  101. // CHECK:STDOUT: %a.param_patt: @HandleAnimal.%pattern_type (%pattern_type.29d) = value_param_pattern %a.patt, call_param0 [concrete]
  102. // CHECK:STDOUT: } {
  103. // CHECK:STDOUT: %.loc19_21: type = splice_block %Animal.ref [concrete = constants.%Animal.type] {
  104. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  105. // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type]
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT: %T.loc19_17.2: %Animal.type = bind_symbolic_name T, 0 [symbolic = %T.loc19_17.1 (constants.%T)]
  108. // CHECK:STDOUT: %a.param: @HandleAnimal.%T.as_type.loc19_32.1 (%T.as_type) = value_param call_param0
  109. // CHECK:STDOUT: %.loc19_32.1: type = splice_block %.loc19_32.2 [symbolic = %T.as_type.loc19_32.1 (constants.%T.as_type)] {
  110. // CHECK:STDOUT: %T.ref: %Animal.type = name_ref T, %T.loc19_17.2 [symbolic = %T.loc19_17.1 (constants.%T)]
  111. // CHECK:STDOUT: %T.as_type.loc19_32.2: type = facet_access_type %T.ref [symbolic = %T.as_type.loc19_32.1 (constants.%T.as_type)]
  112. // CHECK:STDOUT: %.loc19_32.2: type = converted %T.ref, %T.as_type.loc19_32.2 [symbolic = %T.as_type.loc19_32.1 (constants.%T.as_type)]
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT: %a: @HandleAnimal.%T.as_type.loc19_32.1 (%T.as_type) = bind_name a, %a.param
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT: %Goat.decl: type = class_decl @Goat [concrete = constants.%Goat] {} {}
  117. // CHECK:STDOUT: impl_decl @Goat.as.Animal.impl [concrete] {} {
  118. // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat]
  119. // CHECK:STDOUT: %Animal.ref: type = name_ref Animal, file.%Animal.decl [concrete = constants.%Animal.type]
  120. // CHECK:STDOUT: }
  121. // CHECK:STDOUT: %Animal.impl_witness_table = impl_witness_table (), @Goat.as.Animal.impl [concrete]
  122. // CHECK:STDOUT: %Animal.impl_witness: <witness> = impl_witness %Animal.impl_witness_table [concrete = constants.%Animal.impl_witness]
  123. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT:
  126. // CHECK:STDOUT: interface @Animal {
  127. // CHECK:STDOUT: %Self: %Animal.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.611]
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: !members:
  130. // CHECK:STDOUT: .Self = %Self
  131. // CHECK:STDOUT: witness = ()
  132. // CHECK:STDOUT: }
  133. // CHECK:STDOUT:
  134. // CHECK:STDOUT: impl @Goat.as.Destroy.impl: @Goat.%Self.ref as constants.%Destroy.type {
  135. // CHECK:STDOUT: %Goat.as.Destroy.impl.Op.decl: %Goat.as.Destroy.impl.Op.type = fn_decl @Goat.as.Destroy.impl.Op [concrete = constants.%Goat.as.Destroy.impl.Op] {
  136. // CHECK:STDOUT: %self.patt: %pattern_type.396 = binding_pattern self [concrete]
  137. // CHECK:STDOUT: %self.param_patt: %pattern_type.396 = value_param_pattern %self.patt, call_param0 [concrete]
  138. // CHECK:STDOUT: %.loc21: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  139. // CHECK:STDOUT: } {
  140. // CHECK:STDOUT: %self.param: %ptr.940 = value_param call_param0
  141. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Goat [concrete = constants.%Goat]
  142. // CHECK:STDOUT: %self: %ptr.940 = bind_name self, %self.param
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: !members:
  146. // CHECK:STDOUT: .Op = %Goat.as.Destroy.impl.Op.decl
  147. // CHECK:STDOUT: witness = @Goat.%Destroy.impl_witness
  148. // CHECK:STDOUT: }
  149. // CHECK:STDOUT:
  150. // CHECK:STDOUT: impl @Goat.as.Animal.impl: %Goat.ref as %Animal.ref {
  151. // CHECK:STDOUT: !members:
  152. // CHECK:STDOUT: witness = file.%Animal.impl_witness
  153. // CHECK:STDOUT: }
  154. // CHECK:STDOUT:
  155. // CHECK:STDOUT: class @Goat {
  156. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Goat [concrete = constants.%Goat]
  157. // CHECK:STDOUT: impl_decl @Goat.as.Destroy.impl [concrete] {} {}
  158. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@Goat.as.Destroy.impl.%Goat.as.Destroy.impl.Op.decl), @Goat.as.Destroy.impl [concrete]
  159. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.06d]
  160. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  161. // CHECK:STDOUT: complete_type_witness = %complete_type
  162. // CHECK:STDOUT:
  163. // CHECK:STDOUT: !members:
  164. // CHECK:STDOUT: .Self = constants.%Goat
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: generic fn @FeedAnimal(%T.loc17_15.2: %Animal.type) {
  168. // CHECK:STDOUT: %T.loc17_15.1: %Animal.type = bind_symbolic_name T, 0 [symbolic = %T.loc17_15.1 (constants.%T)]
  169. // CHECK:STDOUT: %T.as_type.loc17_30.1: type = facet_access_type %T.loc17_15.1 [symbolic = %T.as_type.loc17_30.1 (constants.%T.as_type)]
  170. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc17_30.1 [symbolic = %pattern_type (constants.%pattern_type.29d)]
  171. // CHECK:STDOUT:
  172. // CHECK:STDOUT: !definition:
  173. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc17_30.1 [symbolic = %require_complete (constants.%require_complete.210)]
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: fn(%a.param: @FeedAnimal.%T.as_type.loc17_30.1 (%T.as_type)) {
  176. // CHECK:STDOUT: !entry:
  177. // CHECK:STDOUT: return
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT: }
  180. // CHECK:STDOUT:
  181. // CHECK:STDOUT: generic fn @HandleAnimal(%T.loc19_17.2: %Animal.type) {
  182. // CHECK:STDOUT: %T.loc19_17.1: %Animal.type = bind_symbolic_name T, 0 [symbolic = %T.loc19_17.1 (constants.%T)]
  183. // CHECK:STDOUT: %T.as_type.loc19_32.1: type = facet_access_type %T.loc19_17.1 [symbolic = %T.as_type.loc19_32.1 (constants.%T.as_type)]
  184. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.as_type.loc19_32.1 [symbolic = %pattern_type (constants.%pattern_type.29d)]
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: !definition:
  187. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc19_32.1 [symbolic = %require_complete (constants.%require_complete.210)]
  188. // CHECK:STDOUT: %FeedAnimal.specific_fn.loc19_37.2: <specific function> = specific_function constants.%FeedAnimal, @FeedAnimal(%T.loc19_17.1) [symbolic = %FeedAnimal.specific_fn.loc19_37.2 (constants.%FeedAnimal.specific_fn.a33)]
  189. // CHECK:STDOUT:
  190. // CHECK:STDOUT: fn(%a.param: @HandleAnimal.%T.as_type.loc19_32.1 (%T.as_type)) {
  191. // CHECK:STDOUT: !entry:
  192. // CHECK:STDOUT: %FeedAnimal.ref: %FeedAnimal.type = name_ref FeedAnimal, file.%FeedAnimal.decl [concrete = constants.%FeedAnimal]
  193. // CHECK:STDOUT: %a.ref: @HandleAnimal.%T.as_type.loc19_32.1 (%T.as_type) = name_ref a, %a
  194. // CHECK:STDOUT: %.loc19_49.1: %Animal.type = converted constants.%T.as_type, constants.%T [symbolic = %T.loc19_17.1 (constants.%T)]
  195. // CHECK:STDOUT: %.loc19_49.2: %Animal.type = converted constants.%T.as_type, constants.%T [symbolic = %T.loc19_17.1 (constants.%T)]
  196. // CHECK:STDOUT: %FeedAnimal.specific_fn.loc19_37.1: <specific function> = specific_function %FeedAnimal.ref, @FeedAnimal(constants.%T) [symbolic = %FeedAnimal.specific_fn.loc19_37.2 (constants.%FeedAnimal.specific_fn.a33)]
  197. // CHECK:STDOUT: %FeedAnimal.call: init %empty_tuple.type = call %FeedAnimal.specific_fn.loc19_37.1(%a.ref)
  198. // CHECK:STDOUT: return
  199. // CHECK:STDOUT: }
  200. // CHECK:STDOUT: }
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: fn @Goat.as.Destroy.impl.Op(%self.param: %ptr.940) = "no_op";
  203. // CHECK:STDOUT:
  204. // CHECK:STDOUT: fn @F() {
  205. // CHECK:STDOUT: !entry:
  206. // CHECK:STDOUT: %HandleAnimal.ref: %HandleAnimal.type = name_ref HandleAnimal, file.%HandleAnimal.decl [concrete = constants.%HandleAnimal]
  207. // CHECK:STDOUT: %.loc25_17.1: %empty_struct_type = struct_literal ()
  208. // CHECK:STDOUT: %Goat.ref: type = name_ref Goat, file.%Goat.decl [concrete = constants.%Goat]
  209. // CHECK:STDOUT: %.loc25_17.2: ref %Goat = temporary_storage
  210. // CHECK:STDOUT: %.loc25_17.3: init %Goat = class_init (), %.loc25_17.2 [concrete = constants.%Goat.val]
  211. // CHECK:STDOUT: %.loc25_17.4: ref %Goat = temporary %.loc25_17.2, %.loc25_17.3
  212. // CHECK:STDOUT: %.loc25_19.1: ref %Goat = converted %.loc25_17.1, %.loc25_17.4
  213. // CHECK:STDOUT: %Animal.facet.loc25_26.1: %Animal.type = facet_value constants.%Goat, (constants.%Animal.impl_witness) [concrete = constants.%Animal.facet]
  214. // CHECK:STDOUT: %.loc25_26.1: %Animal.type = converted constants.%Goat, %Animal.facet.loc25_26.1 [concrete = constants.%Animal.facet]
  215. // CHECK:STDOUT: %Animal.facet.loc25_26.2: %Animal.type = facet_value constants.%Goat, (constants.%Animal.impl_witness) [concrete = constants.%Animal.facet]
  216. // CHECK:STDOUT: %.loc25_26.2: %Animal.type = converted constants.%Goat, %Animal.facet.loc25_26.2 [concrete = constants.%Animal.facet]
  217. // CHECK:STDOUT: %HandleAnimal.specific_fn: <specific function> = specific_function %HandleAnimal.ref, @HandleAnimal(constants.%Animal.facet) [concrete = constants.%HandleAnimal.specific_fn]
  218. // CHECK:STDOUT: %.loc25_19.2: %Goat = bind_value %.loc25_19.1
  219. // CHECK:STDOUT: %HandleAnimal.call: init %empty_tuple.type = call %HandleAnimal.specific_fn(%.loc25_19.2)
  220. // CHECK:STDOUT: %Goat.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc25_17.4, constants.%Goat.as.Destroy.impl.Op
  221. // CHECK:STDOUT: %addr: %ptr.940 = addr_of %.loc25_17.4
  222. // CHECK:STDOUT: %Goat.as.Destroy.impl.Op.call: init %empty_tuple.type = call %Goat.as.Destroy.impl.Op.bound(%addr)
  223. // CHECK:STDOUT: return
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT: specific @FeedAnimal(constants.%T) {
  227. // CHECK:STDOUT: %T.loc17_15.1 => constants.%T
  228. // CHECK:STDOUT: %T.as_type.loc17_30.1 => constants.%T.as_type
  229. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.29d
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: !definition:
  232. // CHECK:STDOUT: %require_complete => constants.%require_complete.210
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: specific @HandleAnimal(constants.%T) {
  236. // CHECK:STDOUT: %T.loc19_17.1 => constants.%T
  237. // CHECK:STDOUT: %T.as_type.loc19_32.1 => constants.%T.as_type
  238. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.29d
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: specific @HandleAnimal(constants.%Animal.facet) {
  242. // CHECK:STDOUT: %T.loc19_17.1 => constants.%Animal.facet
  243. // CHECK:STDOUT: %T.as_type.loc19_32.1 => constants.%Goat
  244. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ab7
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: !definition:
  247. // CHECK:STDOUT: %require_complete => constants.%complete_type
  248. // CHECK:STDOUT: %FeedAnimal.specific_fn.loc19_37.2 => constants.%FeedAnimal.specific_fn.2ba
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: specific @FeedAnimal(constants.%Animal.facet) {
  252. // CHECK:STDOUT: %T.loc17_15.1 => constants.%Animal.facet
  253. // CHECK:STDOUT: %T.as_type.loc17_30.1 => constants.%Goat
  254. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ab7
  255. // CHECK:STDOUT:
  256. // CHECK:STDOUT: !definition:
  257. // CHECK:STDOUT: %require_complete => constants.%complete_type
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT: