import_use_generic.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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/impl/no_prelude/import_use_generic.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon
  10. // --- import_generic.carbon
  11. library "[[@TEST_NAME]]";
  12. class C(T:! type) {}
  13. interface I {
  14. fn F();
  15. }
  16. impl forall [T:! type] C(T) as I {
  17. fn F() {}
  18. }
  19. // --- fail_use_in_fn_decl.carbon
  20. library "[[@TEST_NAME]]";
  21. import library "import_generic";
  22. var c: C({}) = {};
  23. // We're just checking that this doesn't crash. It's not expected to compile.
  24. // CHECK:STDERR: fail_use_in_fn_decl.carbon:[[@LINE+7]]:11: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound]
  25. // CHECK:STDERR: fn F() -> c.(I.F)() {}
  26. // CHECK:STDERR: ^~~~~~~~~
  27. // CHECK:STDERR:
  28. // CHECK:STDERR: fail_use_in_fn_decl.carbon:[[@LINE+3]]:22: error: missing `return` at end of function with declared return type [MissingReturnStatement]
  29. // CHECK:STDERR: fn F() -> c.(I.F)() {}
  30. // CHECK:STDERR: ^
  31. fn F() -> c.(I.F)() {}
  32. // CHECK:STDOUT: --- import_generic.carbon
  33. // CHECK:STDOUT:
  34. // CHECK:STDOUT: constants {
  35. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  36. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  37. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  38. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  39. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic]
  40. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  41. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  42. // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
  43. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  44. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
  45. // CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
  46. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template]
  47. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template]
  48. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic]
  49. // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic]
  50. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %C [symbolic]
  51. // CHECK:STDOUT: %interface: <witness> = interface_witness (%F.2) [symbolic]
  52. // CHECK:STDOUT: }
  53. // CHECK:STDOUT:
  54. // CHECK:STDOUT: file {
  55. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  56. // CHECK:STDOUT: .C = %C.decl
  57. // CHECK:STDOUT: .I = %I.decl
  58. // CHECK:STDOUT: }
  59. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  60. // CHECK:STDOUT: %T.patt.loc4_9.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)]
  61. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_9.1, runtime_param<invalid> [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)]
  62. // CHECK:STDOUT: } {
  63. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  64. // CHECK:STDOUT: %T.loc4_9.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_9.2 (constants.%T)]
  65. // CHECK:STDOUT: }
  66. // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%I.type] {} {}
  67. // CHECK:STDOUT: impl_decl @impl [template] {
  68. // CHECK:STDOUT: %T.patt.loc10_14.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt)]
  69. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc10_14.1, runtime_param<invalid> [symbolic = %T.patt.loc10_14.2 (constants.%T.patt)]
  70. // CHECK:STDOUT: } {
  71. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  72. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc10_14.1 [symbolic = %T.loc10_14.2 (constants.%T)]
  73. // CHECK:STDOUT: %C.loc10_27.1: type = class_type @C, @C(constants.%T) [symbolic = %C.loc10_27.2 (constants.%C)]
  74. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [template = constants.%I.type]
  75. // CHECK:STDOUT: %T.param: type = value_param runtime_param<invalid>
  76. // CHECK:STDOUT: %T.loc10_14.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_14.2 (constants.%T)]
  77. // CHECK:STDOUT: }
  78. // CHECK:STDOUT: }
  79. // CHECK:STDOUT:
  80. // CHECK:STDOUT: interface @I {
  81. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  82. // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {} {}
  83. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0]
  84. // CHECK:STDOUT:
  85. // CHECK:STDOUT: !members:
  86. // CHECK:STDOUT: .Self = %Self
  87. // CHECK:STDOUT: .F = %assoc0
  88. // CHECK:STDOUT: witness = (%F.decl)
  89. // CHECK:STDOUT: }
  90. // CHECK:STDOUT:
  91. // CHECK:STDOUT: generic impl @impl(%T.loc10_14.1: type) {
  92. // CHECK:STDOUT: %T.loc10_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.2 (constants.%T)]
  93. // CHECK:STDOUT: %T.patt.loc10_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt)]
  94. // CHECK:STDOUT: %C.loc10_27.2: type = class_type @C, @C(%T.loc10_14.2) [symbolic = %C.loc10_27.2 (constants.%C)]
  95. // CHECK:STDOUT:
  96. // CHECK:STDOUT: !definition:
  97. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc10_14.2) [symbolic = %F.type (constants.%F.type.2)]
  98. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)]
  99. // CHECK:STDOUT: %interface.loc10_34.2: <witness> = interface_witness (%F) [symbolic = %interface.loc10_34.2 (constants.%interface)]
  100. // CHECK:STDOUT:
  101. // CHECK:STDOUT: impl: %C.loc10_27.1 as %I.ref {
  102. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.2) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.2)] {} {}
  103. // CHECK:STDOUT: %interface.loc10_34.1: <witness> = interface_witness (%F.decl) [symbolic = %interface.loc10_34.2 (constants.%interface)]
  104. // CHECK:STDOUT:
  105. // CHECK:STDOUT: !members:
  106. // CHECK:STDOUT: .F = %F.decl
  107. // CHECK:STDOUT: witness = %interface.loc10_34.1
  108. // CHECK:STDOUT: }
  109. // CHECK:STDOUT: }
  110. // CHECK:STDOUT:
  111. // CHECK:STDOUT: generic class @C(%T.loc4_9.1: type) {
  112. // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_9.2 (constants.%T)]
  113. // CHECK:STDOUT: %T.patt.loc4_9.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_9.2 (constants.%T.patt)]
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: !definition:
  116. // CHECK:STDOUT:
  117. // CHECK:STDOUT: class {
  118. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  119. // CHECK:STDOUT:
  120. // CHECK:STDOUT: !members:
  121. // CHECK:STDOUT: .Self = constants.%C
  122. // CHECK:STDOUT: complete_type_witness = %complete_type
  123. // CHECK:STDOUT: }
  124. // CHECK:STDOUT: }
  125. // CHECK:STDOUT:
  126. // CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
  127. // CHECK:STDOUT:
  128. // CHECK:STDOUT: fn();
  129. // CHECK:STDOUT: }
  130. // CHECK:STDOUT:
  131. // CHECK:STDOUT: generic fn @F.2(@impl.%T.loc10_14.1: type) {
  132. // CHECK:STDOUT: !definition:
  133. // CHECK:STDOUT:
  134. // CHECK:STDOUT: fn() {
  135. // CHECK:STDOUT: !entry:
  136. // CHECK:STDOUT: return
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT: }
  139. // CHECK:STDOUT:
  140. // CHECK:STDOUT: specific @C(constants.%T) {
  141. // CHECK:STDOUT: %T.loc4_9.2 => constants.%T
  142. // CHECK:STDOUT: %T.patt.loc4_9.2 => constants.%T
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  146. // CHECK:STDOUT:
  147. // CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {}
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: specific @impl(constants.%T) {
  150. // CHECK:STDOUT: %T.loc10_14.2 => constants.%T
  151. // CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T
  152. // CHECK:STDOUT: %C.loc10_27.2 => constants.%C
  153. // CHECK:STDOUT:
  154. // CHECK:STDOUT: !definition:
  155. // CHECK:STDOUT: %F.type => constants.%F.type.2
  156. // CHECK:STDOUT: %F => constants.%F.2
  157. // CHECK:STDOUT: %interface.loc10_34.2 => constants.%interface
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: specific @F.2(constants.%T) {}
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {}
  163. // CHECK:STDOUT:
  164. // CHECK:STDOUT: specific @impl(%T.loc10_14.2) {}
  165. // CHECK:STDOUT:
  166. // CHECK:STDOUT: --- fail_use_in_fn_decl.carbon
  167. // CHECK:STDOUT:
  168. // CHECK:STDOUT: constants {
  169. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  170. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  171. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  172. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  173. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  174. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  175. // CHECK:STDOUT: %C.1: type = class_type @C, @C(%T) [symbolic]
  176. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  177. // CHECK:STDOUT: %C.2: type = class_type @C, @C(%empty_struct_type) [template]
  178. // CHECK:STDOUT: %C.val: %C.2 = struct_value () [template]
  179. // CHECK:STDOUT: %I.type: type = facet_type <@I> [template]
  180. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  181. // CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
  182. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.1 [template]
  183. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.8 [template]
  184. // CHECK:STDOUT: %F.type.2: type = fn_type @F.2, @impl(%T) [symbolic]
  185. // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [symbolic]
  186. // CHECK:STDOUT: %interface.1: <witness> = interface_witness (%F.2) [symbolic]
  187. // CHECK:STDOUT: %F.type.3: type = fn_type @F.2, @impl(%empty_struct_type) [template]
  188. // CHECK:STDOUT: %F.3: %F.type.3 = struct_value () [template]
  189. // CHECK:STDOUT: %interface.2: <witness> = interface_witness (%F.3) [template]
  190. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.3, @F.2(%empty_struct_type) [template]
  191. // CHECK:STDOUT: %F.type.4: type = fn_type @F.3 [template]
  192. // CHECK:STDOUT: %F.4: %F.type.4 = struct_value () [template]
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: imports {
  196. // CHECK:STDOUT: %import_ref.1: %C.type = import_ref Main//import_generic, C, loaded [template = constants.%C.generic]
  197. // CHECK:STDOUT: %import_ref.2: type = import_ref Main//import_generic, I, loaded [template = constants.%I.type]
  198. // CHECK:STDOUT: %import_ref.3: <witness> = import_ref Main//import_generic, loc4_20, loaded [template = constants.%complete_type]
  199. // CHECK:STDOUT: %import_ref.4 = import_ref Main//import_generic, inst25 [no loc], unloaded
  200. // CHECK:STDOUT: %import_ref.5 = import_ref Main//import_generic, inst31 [no loc], unloaded
  201. // CHECK:STDOUT: %import_ref.6: %F.assoc_type = import_ref Main//import_generic, loc7_9, loaded [template = constants.%assoc0]
  202. // CHECK:STDOUT: %import_ref.7 = import_ref Main//import_generic, F, unloaded
  203. // CHECK:STDOUT: %import_ref.9: type = import_ref Main//import_generic, loc10_27, loaded [symbolic = @impl.%C (constants.%C.1)]
  204. // CHECK:STDOUT: %import_ref.10: type = import_ref Main//import_generic, loc10_32, loaded [template = constants.%I.type]
  205. // CHECK:STDOUT: %import_ref.11: <witness> = import_ref Main//import_generic, loc10_34, loaded [symbolic = @impl.%interface (constants.%interface.1)]
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: file {
  209. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  210. // CHECK:STDOUT: .C = imports.%import_ref.1
  211. // CHECK:STDOUT: .I = imports.%import_ref.2
  212. // CHECK:STDOUT: .c = %c
  213. // CHECK:STDOUT: .F = %F.decl
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT: %default.import = import <invalid>
  216. // CHECK:STDOUT: %c.var: ref %C.2 = var c
  217. // CHECK:STDOUT: %c: ref %C.2 = bind_name c, %c.var
  218. // CHECK:STDOUT: %F.decl: %F.type.4 = fn_decl @F.3 [template = constants.%F.4] {
  219. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern
  220. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, runtime_param0
  221. // CHECK:STDOUT: } {
  222. // CHECK:STDOUT: %c.ref: ref %C.2 = name_ref c, file.%c
  223. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.2 [template = constants.%I.type]
  224. // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.6 [template = constants.%assoc0]
  225. // CHECK:STDOUT: %impl.elem0: %F.type.1 = interface_witness_access constants.%interface.2, element0 [template = constants.%F.3]
  226. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn]
  227. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
  228. // CHECK:STDOUT: %.loc15_19.1: ref %empty_tuple.type = temporary_storage
  229. // CHECK:STDOUT: %.loc15_19.2: ref %empty_tuple.type = temporary %.loc15_19.1, %F.call
  230. // CHECK:STDOUT: %.loc15_19.3: type = converted %F.call, <error> [template = <error>]
  231. // CHECK:STDOUT: %return.param: ref <error> = out_param runtime_param0
  232. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: }
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: interface @I [from "import_generic.carbon"] {
  237. // CHECK:STDOUT: !members:
  238. // CHECK:STDOUT: .Self = imports.%import_ref.5
  239. // CHECK:STDOUT: .F = imports.%import_ref.6
  240. // CHECK:STDOUT: witness = (imports.%import_ref.7)
  241. // CHECK:STDOUT: }
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: generic impl @impl(constants.%T: type) [from "import_generic.carbon"] {
  244. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  245. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  246. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.1)]
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: !definition:
  249. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T) [symbolic = %F.type (constants.%F.type.2)]
  250. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2) = struct_value () [symbolic = %F (constants.%F.2)]
  251. // CHECK:STDOUT: %interface: <witness> = interface_witness (%F) [symbolic = %interface (constants.%interface.1)]
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: impl: imports.%import_ref.9 as imports.%import_ref.10 {
  254. // CHECK:STDOUT: !members:
  255. // CHECK:STDOUT: witness = imports.%import_ref.11
  256. // CHECK:STDOUT: }
  257. // CHECK:STDOUT: }
  258. // CHECK:STDOUT:
  259. // CHECK:STDOUT: generic class @C(constants.%T: type) [from "import_generic.carbon"] {
  260. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  261. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: !definition:
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: class {
  266. // CHECK:STDOUT: !members:
  267. // CHECK:STDOUT: .Self = imports.%import_ref.4
  268. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.3
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "import_generic.carbon"] {
  273. // CHECK:STDOUT:
  274. // CHECK:STDOUT: fn();
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: generic fn @F.2(constants.%T: type) [from "import_generic.carbon"] {
  278. // CHECK:STDOUT: !definition:
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: fn();
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: fn @F.3() -> <error> {
  284. // CHECK:STDOUT: !entry:
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: fn @__global_init() {
  288. // CHECK:STDOUT: !entry:
  289. // CHECK:STDOUT: %.loc6_17.1: %empty_struct_type = struct_literal ()
  290. // CHECK:STDOUT: %.loc6_17.2: init %C.2 = class_init (), file.%c.var [template = constants.%C.val]
  291. // CHECK:STDOUT: %.loc6_18: init %C.2 = converted %.loc6_17.1, %.loc6_17.2 [template = constants.%C.val]
  292. // CHECK:STDOUT: assign file.%c.var, %.loc6_18
  293. // CHECK:STDOUT: return
  294. // CHECK:STDOUT: }
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: specific @C(constants.%T) {
  297. // CHECK:STDOUT: %T => constants.%T
  298. // CHECK:STDOUT: %T.patt => constants.%T
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: specific @C(constants.%empty_struct_type) {
  302. // CHECK:STDOUT: %T => constants.%empty_struct_type
  303. // CHECK:STDOUT: %T.patt => constants.%empty_struct_type
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: !definition:
  306. // CHECK:STDOUT: }
  307. // CHECK:STDOUT:
  308. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  309. // CHECK:STDOUT:
  310. // CHECK:STDOUT: specific @C(@impl.%T) {}
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: specific @impl(constants.%T) {
  313. // CHECK:STDOUT: %T => constants.%T
  314. // CHECK:STDOUT: %T.patt => constants.%T
  315. // CHECK:STDOUT: %C => constants.%C.1
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: !definition:
  318. // CHECK:STDOUT: %F.type => constants.%F.type.2
  319. // CHECK:STDOUT: %F => constants.%F.2
  320. // CHECK:STDOUT: %interface => constants.%interface.1
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: specific @impl(%T) {}
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: specific @F.2(constants.%T) {}
  326. // CHECK:STDOUT:
  327. // CHECK:STDOUT: specific @impl(constants.%empty_struct_type) {
  328. // CHECK:STDOUT: %T => constants.%empty_struct_type
  329. // CHECK:STDOUT: %T.patt => constants.%empty_struct_type
  330. // CHECK:STDOUT: %C => constants.%C.2
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: !definition:
  333. // CHECK:STDOUT: %F.type => constants.%F.type.3
  334. // CHECK:STDOUT: %F => constants.%F.3
  335. // CHECK:STDOUT: %interface => constants.%interface.2
  336. // CHECK:STDOUT: }
  337. // CHECK:STDOUT:
  338. // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) {
  339. // CHECK:STDOUT: !definition:
  340. // CHECK:STDOUT: }
  341. // CHECK:STDOUT: