import_use_generic.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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.9df: type = fn_type @F.1 [template]
  45. // CHECK:STDOUT: %F.478: %F.type.9df = struct_value () [template]
  46. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.9df [template]
  47. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, @I.%F.decl [template]
  48. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%F.decl), @impl(%T) [symbolic]
  49. // CHECK:STDOUT: %F.type.7bd: type = fn_type @F.2, @impl(%T) [symbolic]
  50. // CHECK:STDOUT: %F.3d2: %F.type.7bd = struct_value () [symbolic]
  51. // CHECK:STDOUT: %I.facet: %I.type = facet_value %C, %impl_witness [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: %impl_witness: <witness> = impl_witness (@impl.%F.decl), @impl(constants.%T) [symbolic = @impl.%impl_witness (constants.%impl_witness)]
  79. // CHECK:STDOUT: }
  80. // CHECK:STDOUT:
  81. // CHECK:STDOUT: interface @I {
  82. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  83. // CHECK:STDOUT: %F.decl: %F.type.9df = fn_decl @F.1 [template = constants.%F.478] {} {}
  84. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, %F.decl [template = constants.%assoc0]
  85. // CHECK:STDOUT:
  86. // CHECK:STDOUT: !members:
  87. // CHECK:STDOUT: .Self = %Self
  88. // CHECK:STDOUT: .F = %assoc0
  89. // CHECK:STDOUT: witness = (%F.decl)
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT:
  92. // CHECK:STDOUT: generic impl @impl(%T.loc10_14.1: type) {
  93. // CHECK:STDOUT: %T.loc10_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_14.2 (constants.%T)]
  94. // CHECK:STDOUT: %T.patt.loc10_14.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_14.2 (constants.%T.patt)]
  95. // CHECK:STDOUT: %C.loc10_27.2: type = class_type @C, @C(%T.loc10_14.2) [symbolic = %C.loc10_27.2 (constants.%C)]
  96. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (%F.decl), @impl(%T.loc10_14.2) [symbolic = %impl_witness (constants.%impl_witness)]
  97. // CHECK:STDOUT:
  98. // CHECK:STDOUT: !definition:
  99. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T.loc10_14.2) [symbolic = %F.type (constants.%F.type.7bd)]
  100. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.7bd) = struct_value () [symbolic = %F (constants.%F.3d2)]
  101. // CHECK:STDOUT:
  102. // CHECK:STDOUT: impl: %C.loc10_27.1 as %I.ref {
  103. // CHECK:STDOUT: %F.decl: @impl.%F.type (%F.type.7bd) = fn_decl @F.2 [symbolic = @impl.%F (constants.%F.3d2)] {} {}
  104. // CHECK:STDOUT:
  105. // CHECK:STDOUT: !members:
  106. // CHECK:STDOUT: .F = %F.decl
  107. // CHECK:STDOUT: witness = file.%impl_witness
  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 @impl(constants.%T) {
  148. // CHECK:STDOUT: %T.loc10_14.2 => constants.%T
  149. // CHECK:STDOUT: %T.patt.loc10_14.2 => constants.%T
  150. // CHECK:STDOUT: %C.loc10_27.2 => constants.%C
  151. // CHECK:STDOUT: %impl_witness => constants.%impl_witness
  152. // CHECK:STDOUT:
  153. // CHECK:STDOUT: !definition:
  154. // CHECK:STDOUT: %F.type => constants.%F.type.7bd
  155. // CHECK:STDOUT: %F => constants.%F.3d2
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: specific @C(@impl.%T.loc10_14.2) {}
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: specific @impl(%T.loc10_14.2) {}
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: specific @F.2(constants.%T) {}
  163. // CHECK:STDOUT:
  164. // CHECK:STDOUT: specific @F.1(constants.%I.facet) {}
  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.df4: type = class_type @C, @C(%T) [symbolic]
  176. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  177. // CHECK:STDOUT: %C.a68: type = class_type @C, @C(%empty_struct_type) [template]
  178. // CHECK:STDOUT: %C.val: %C.a68 = 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.9df: type = fn_type @F.1 [template]
  182. // CHECK:STDOUT: %F.assoc_type: type = assoc_entity_type %I.type, %F.type.9df [template]
  183. // CHECK:STDOUT: %assoc0: %F.assoc_type = assoc_entity element0, imports.%import_ref.911 [template]
  184. // CHECK:STDOUT: %impl_witness.1c5: <witness> = impl_witness (imports.%import_ref.a9f), @impl(%T) [symbolic]
  185. // CHECK:STDOUT: %F.type.2f0: type = fn_type @F.2, @impl(%T) [symbolic]
  186. // CHECK:STDOUT: %F.263: %F.type.2f0 = struct_value () [symbolic]
  187. // CHECK:STDOUT: %impl_witness.8a8: <witness> = impl_witness (imports.%import_ref.a9f), @impl(%empty_struct_type) [template]
  188. // CHECK:STDOUT: %impl_witness.4be: <witness> = impl_witness (imports.%import_ref.5d8), @impl(%T) [symbolic]
  189. // CHECK:STDOUT: %F.type.50d: type = fn_type @F.2, @impl(%empty_struct_type) [template]
  190. // CHECK:STDOUT: %F.91e: %F.type.50d = struct_value () [template]
  191. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.91e, @F.2(%empty_struct_type) [template]
  192. // CHECK:STDOUT: %F.type.b25: type = fn_type @F.3 [template]
  193. // CHECK:STDOUT: %F.c41: %F.type.b25 = struct_value () [template]
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: imports {
  197. // CHECK:STDOUT: %import_ref.26e: %C.type = import_ref Main//import_generic, C, loaded [template = constants.%C.generic]
  198. // CHECK:STDOUT: %import_ref.9f4: type = import_ref Main//import_generic, I, loaded [template = constants.%I.type]
  199. // CHECK:STDOUT: %import_ref.8f2: <witness> = import_ref Main//import_generic, loc4_20, loaded [template = constants.%complete_type]
  200. // CHECK:STDOUT: %import_ref.495 = import_ref Main//import_generic, inst25 [no loc], unloaded
  201. // CHECK:STDOUT: %import_ref.f8c = import_ref Main//import_generic, inst31 [no loc], unloaded
  202. // CHECK:STDOUT: %import_ref.145: %F.assoc_type = import_ref Main//import_generic, loc7_9, loaded [template = constants.%assoc0]
  203. // CHECK:STDOUT: %import_ref.a15 = import_ref Main//import_generic, F, unloaded
  204. // CHECK:STDOUT: %import_ref.445: <witness> = import_ref Main//import_generic, loc10_34, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.4be)]
  205. // CHECK:STDOUT: %import_ref.311: type = import_ref Main//import_generic, loc10_27, loaded [symbolic = @impl.%C (constants.%C.df4)]
  206. // CHECK:STDOUT: %import_ref.bd0: type = import_ref Main//import_generic, loc10_32, loaded [template = constants.%I.type]
  207. // CHECK:STDOUT: %import_ref.a9f: @impl.%F.type (%F.type.2f0) = import_ref Main//import_generic, loc11_10, loaded [symbolic = @impl.%F (constants.%F.263)]
  208. // CHECK:STDOUT: }
  209. // CHECK:STDOUT:
  210. // CHECK:STDOUT: file {
  211. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  212. // CHECK:STDOUT: .C = imports.%import_ref.26e
  213. // CHECK:STDOUT: .I = imports.%import_ref.9f4
  214. // CHECK:STDOUT: .c = %c
  215. // CHECK:STDOUT: .F = %F.decl
  216. // CHECK:STDOUT: }
  217. // CHECK:STDOUT: %default.import = import <invalid>
  218. // CHECK:STDOUT: %c.var: ref %C.a68 = var c
  219. // CHECK:STDOUT: %c: ref %C.a68 = bind_name c, %c.var
  220. // CHECK:STDOUT: %F.decl: %F.type.b25 = fn_decl @F.3 [template = constants.%F.c41] {
  221. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern
  222. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, runtime_param0
  223. // CHECK:STDOUT: } {
  224. // CHECK:STDOUT: %c.ref: ref %C.a68 = name_ref c, file.%c
  225. // CHECK:STDOUT: %I.ref: type = name_ref I, imports.%import_ref.9f4 [template = constants.%I.type]
  226. // CHECK:STDOUT: %F.ref: %F.assoc_type = name_ref F, imports.%import_ref.145 [template = constants.%assoc0]
  227. // CHECK:STDOUT: %impl.elem0: %F.type.9df = impl_witness_access constants.%impl_witness.8a8, element0 [template = constants.%F.91e]
  228. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %impl.elem0, @F.2(constants.%empty_struct_type) [template = constants.%F.specific_fn]
  229. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn()
  230. // CHECK:STDOUT: %.loc15_19.1: ref %empty_tuple.type = temporary_storage
  231. // CHECK:STDOUT: %.loc15_19.2: ref %empty_tuple.type = temporary %.loc15_19.1, %F.call
  232. // CHECK:STDOUT: %.loc15_19.3: type = converted %F.call, <error> [template = <error>]
  233. // CHECK:STDOUT: %return.param: ref <error> = out_param runtime_param0
  234. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: interface @I [from "import_generic.carbon"] {
  239. // CHECK:STDOUT: !members:
  240. // CHECK:STDOUT: .Self = imports.%import_ref.f8c
  241. // CHECK:STDOUT: .F = imports.%import_ref.145
  242. // CHECK:STDOUT: witness = (imports.%import_ref.a15)
  243. // CHECK:STDOUT: }
  244. // CHECK:STDOUT:
  245. // CHECK:STDOUT: generic impl @impl(constants.%T: type) [from "import_generic.carbon"] {
  246. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  247. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  248. // CHECK:STDOUT: %C: type = class_type @C, @C(%T) [symbolic = %C (constants.%C.df4)]
  249. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%import_ref.a9f), @impl(%T) [symbolic = %impl_witness (constants.%impl_witness.1c5)]
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: !definition:
  252. // CHECK:STDOUT: %F.type: type = fn_type @F.2, @impl(%T) [symbolic = %F.type (constants.%F.type.2f0)]
  253. // CHECK:STDOUT: %F: @impl.%F.type (%F.type.2f0) = struct_value () [symbolic = %F (constants.%F.263)]
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: impl: imports.%import_ref.311 as imports.%import_ref.bd0 {
  256. // CHECK:STDOUT: !members:
  257. // CHECK:STDOUT: witness = imports.%import_ref.445
  258. // CHECK:STDOUT: }
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: generic class @C(constants.%T: type) [from "import_generic.carbon"] {
  262. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  263. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt (constants.%T.patt)]
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: !definition:
  266. // CHECK:STDOUT:
  267. // CHECK:STDOUT: class {
  268. // CHECK:STDOUT: !members:
  269. // CHECK:STDOUT: .Self = imports.%import_ref.495
  270. // CHECK:STDOUT: complete_type_witness = imports.%import_ref.8f2
  271. // CHECK:STDOUT: }
  272. // CHECK:STDOUT: }
  273. // CHECK:STDOUT:
  274. // CHECK:STDOUT: generic fn @F.1(constants.%Self: %I.type) [from "import_generic.carbon"] {
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: fn();
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: generic fn @F.2(constants.%T: type) [from "import_generic.carbon"] {
  280. // CHECK:STDOUT: !definition:
  281. // CHECK:STDOUT:
  282. // CHECK:STDOUT: fn();
  283. // CHECK:STDOUT: }
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: fn @F.3() -> <error> {
  286. // CHECK:STDOUT: !entry:
  287. // CHECK:STDOUT: }
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: fn @__global_init() {
  290. // CHECK:STDOUT: !entry:
  291. // CHECK:STDOUT: %.loc6_17.1: %empty_struct_type = struct_literal ()
  292. // CHECK:STDOUT: %.loc6_17.2: init %C.a68 = class_init (), file.%c.var [template = constants.%C.val]
  293. // CHECK:STDOUT: %.loc6_18: init %C.a68 = converted %.loc6_17.1, %.loc6_17.2 [template = constants.%C.val]
  294. // CHECK:STDOUT: assign file.%c.var, %.loc6_18
  295. // CHECK:STDOUT: return
  296. // CHECK:STDOUT: }
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: specific @C(constants.%T) {
  299. // CHECK:STDOUT: %T => constants.%T
  300. // CHECK:STDOUT: %T.patt => constants.%T
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: specific @C(constants.%empty_struct_type) {
  304. // CHECK:STDOUT: %T => constants.%empty_struct_type
  305. // CHECK:STDOUT: %T.patt => constants.%empty_struct_type
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: !definition:
  308. // CHECK:STDOUT: }
  309. // CHECK:STDOUT:
  310. // CHECK:STDOUT: specific @F.1(constants.%Self) {}
  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.df4
  316. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.1c5
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: !definition:
  319. // CHECK:STDOUT: %F.type => constants.%F.type.2f0
  320. // CHECK:STDOUT: %F => constants.%F.263
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: specific @C(@impl.%T) {}
  324. // CHECK:STDOUT:
  325. // CHECK:STDOUT: specific @impl(%T) {}
  326. // CHECK:STDOUT:
  327. // CHECK:STDOUT: specific @F.2(constants.%T) {}
  328. // CHECK:STDOUT:
  329. // CHECK:STDOUT: specific @impl(constants.%empty_struct_type) {
  330. // CHECK:STDOUT: %T => constants.%empty_struct_type
  331. // CHECK:STDOUT: %T.patt => constants.%empty_struct_type
  332. // CHECK:STDOUT: %C => constants.%C.a68
  333. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.8a8
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: !definition:
  336. // CHECK:STDOUT: %F.type => constants.%F.type.50d
  337. // CHECK:STDOUT: %F => constants.%F.91e
  338. // CHECK:STDOUT: }
  339. // CHECK:STDOUT:
  340. // CHECK:STDOUT: specific @F.2(constants.%empty_struct_type) {
  341. // CHECK:STDOUT: !definition:
  342. // CHECK:STDOUT: }
  343. // CHECK:STDOUT: