import_base.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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/class/import_base.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/import_base.carbon
  10. // --- a.carbon
  11. library "[[@TEST_NAME]]";
  12. base class Base {
  13. fn F[self: Self]();
  14. fn Unused[self: Self]();
  15. var x: i32;
  16. var unused: i32;
  17. }
  18. class Child {
  19. extend base: Base;
  20. }
  21. // --- b.carbon
  22. library "[[@TEST_NAME]]";
  23. import library "a";
  24. fn Run() {
  25. var a: Child = {.base = {.x = 0, .unused = 1}};
  26. a.x = 2;
  27. a.F();
  28. }
  29. // CHECK:STDOUT: --- a.carbon
  30. // CHECK:STDOUT:
  31. // CHECK:STDOUT: constants {
  32. // CHECK:STDOUT: %Base: type = class_type @Base [concrete]
  33. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  34. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  35. // CHECK:STDOUT: %Unused.type: type = fn_type @Unused [concrete]
  36. // CHECK:STDOUT: %Unused: %Unused.type = struct_value () [concrete]
  37. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  38. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  39. // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [concrete]
  40. // CHECK:STDOUT: %struct_type.x.unused: type = struct_type {.x: %i32, .unused: %i32} [concrete]
  41. // CHECK:STDOUT: %complete_type.20c: <witness> = complete_type_witness %struct_type.x.unused [concrete]
  42. // CHECK:STDOUT: %Child: type = class_type @Child [concrete]
  43. // CHECK:STDOUT: %Child.elem: type = unbound_element_type %Child, %Base [concrete]
  44. // CHECK:STDOUT: %struct_type.base: type = struct_type {.base: %Base} [concrete]
  45. // CHECK:STDOUT: %complete_type.15c: <witness> = complete_type_witness %struct_type.base [concrete]
  46. // CHECK:STDOUT: }
  47. // CHECK:STDOUT:
  48. // CHECK:STDOUT: imports {
  49. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  50. // CHECK:STDOUT: .Int = %Core.Int
  51. // CHECK:STDOUT: import Core//prelude
  52. // CHECK:STDOUT: import Core//prelude/...
  53. // CHECK:STDOUT: }
  54. // CHECK:STDOUT: }
  55. // CHECK:STDOUT:
  56. // CHECK:STDOUT: file {
  57. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  58. // CHECK:STDOUT: .Core = imports.%Core
  59. // CHECK:STDOUT: .Base = %Base.decl
  60. // CHECK:STDOUT: .Child = %Child.decl
  61. // CHECK:STDOUT: }
  62. // CHECK:STDOUT: %Core.import = import Core
  63. // CHECK:STDOUT: %Base.decl: type = class_decl @Base [concrete = constants.%Base] {} {}
  64. // CHECK:STDOUT: %Child.decl: type = class_decl @Child [concrete = constants.%Child] {} {}
  65. // CHECK:STDOUT: }
  66. // CHECK:STDOUT:
  67. // CHECK:STDOUT: class @Base {
  68. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  69. // CHECK:STDOUT: %self.patt: %Base = binding_pattern self
  70. // CHECK:STDOUT: %self.param_patt: %Base = value_param_pattern %self.patt, call_param0
  71. // CHECK:STDOUT: } {
  72. // CHECK:STDOUT: %self.param: %Base = value_param call_param0
  73. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [concrete = constants.%Base]
  74. // CHECK:STDOUT: %self: %Base = bind_name self, %self.param
  75. // CHECK:STDOUT: }
  76. // CHECK:STDOUT: %Unused.decl: %Unused.type = fn_decl @Unused [concrete = constants.%Unused] {
  77. // CHECK:STDOUT: %self.patt: %Base = binding_pattern self
  78. // CHECK:STDOUT: %self.param_patt: %Base = value_param_pattern %self.patt, call_param0
  79. // CHECK:STDOUT: } {
  80. // CHECK:STDOUT: %self.param: %Base = value_param call_param0
  81. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [concrete = constants.%Base]
  82. // CHECK:STDOUT: %self: %Base = bind_name self, %self.param
  83. // CHECK:STDOUT: }
  84. // CHECK:STDOUT: %.loc8_8: %Base.elem = field_decl x, element0 [concrete]
  85. // CHECK:STDOUT: name_binding_decl {
  86. // CHECK:STDOUT: %.loc8_3: %Base.elem = var_pattern %.loc8_8
  87. // CHECK:STDOUT: }
  88. // CHECK:STDOUT: %.var.loc8: ref %Base.elem = var <none>
  89. // CHECK:STDOUT: %.loc9_13: %Base.elem = field_decl unused, element1 [concrete]
  90. // CHECK:STDOUT: name_binding_decl {
  91. // CHECK:STDOUT: %.loc9_3: %Base.elem = var_pattern %.loc9_13
  92. // CHECK:STDOUT: }
  93. // CHECK:STDOUT: %.var.loc9: ref %Base.elem = var <none>
  94. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x.unused [concrete = constants.%complete_type.20c]
  95. // CHECK:STDOUT: complete_type_witness = %complete_type
  96. // CHECK:STDOUT:
  97. // CHECK:STDOUT: !members:
  98. // CHECK:STDOUT: .Self = constants.%Base
  99. // CHECK:STDOUT: .F = %F.decl
  100. // CHECK:STDOUT: .Unused = %Unused.decl
  101. // CHECK:STDOUT: .x = %.loc8_8
  102. // CHECK:STDOUT: .unused = %.loc9_13
  103. // CHECK:STDOUT: }
  104. // CHECK:STDOUT:
  105. // CHECK:STDOUT: class @Child {
  106. // CHECK:STDOUT: %Base.ref: type = name_ref Base, file.%Base.decl [concrete = constants.%Base]
  107. // CHECK:STDOUT: %.loc13: %Child.elem = base_decl %Base.ref, element0 [concrete]
  108. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base [concrete = constants.%complete_type.15c]
  109. // CHECK:STDOUT: complete_type_witness = %complete_type
  110. // CHECK:STDOUT:
  111. // CHECK:STDOUT: !members:
  112. // CHECK:STDOUT: .Self = constants.%Child
  113. // CHECK:STDOUT: .Base = <poisoned>
  114. // CHECK:STDOUT: .base = %.loc13
  115. // CHECK:STDOUT: extend %Base.ref
  116. // CHECK:STDOUT: }
  117. // CHECK:STDOUT:
  118. // CHECK:STDOUT: fn @F[%self.param_patt: %Base]();
  119. // CHECK:STDOUT:
  120. // CHECK:STDOUT: fn @Unused[%self.param_patt: %Base]();
  121. // CHECK:STDOUT:
  122. // CHECK:STDOUT: --- b.carbon
  123. // CHECK:STDOUT:
  124. // CHECK:STDOUT: constants {
  125. // CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete]
  126. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  127. // CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete]
  128. // CHECK:STDOUT: %Child: type = class_type @Child [concrete]
  129. // CHECK:STDOUT: %Base: type = class_type @Base [concrete]
  130. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  131. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  132. // CHECK:STDOUT: %struct_type.x.unused.7d5: type = struct_type {.x: %i32, .unused: %i32} [concrete]
  133. // CHECK:STDOUT: %complete_type.90f: <witness> = complete_type_witness %struct_type.x.unused.7d5 [concrete]
  134. // CHECK:STDOUT: %struct_type.base.b1e: type = struct_type {.base: %Base} [concrete]
  135. // CHECK:STDOUT: %complete_type.15c: <witness> = complete_type_witness %struct_type.base.b1e [concrete]
  136. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  137. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  138. // CHECK:STDOUT: %struct_type.x.unused.c45: type = struct_type {.x: Core.IntLiteral, .unused: Core.IntLiteral} [concrete]
  139. // CHECK:STDOUT: %struct_type.base.6c7: type = struct_type {.base: %struct_type.x.unused.c45} [concrete]
  140. // CHECK:STDOUT: %ImplicitAs.type.9ba: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  141. // CHECK:STDOUT: %Convert.type.6da: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  142. // CHECK:STDOUT: %impl_witness.b97: <witness> = impl_witness (imports.%Core.import_ref.a86), @impl.c81(%int_32) [concrete]
  143. // CHECK:STDOUT: %Convert.type.ed5: type = fn_type @Convert.2, @impl.c81(%int_32) [concrete]
  144. // CHECK:STDOUT: %Convert.16d: %Convert.type.ed5 = struct_value () [concrete]
  145. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, (%impl_witness.b97) [concrete]
  146. // CHECK:STDOUT: %.b14: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete]
  147. // CHECK:STDOUT: %Convert.bound.9aa: <bound method> = bound_method %int_0.5c6, %Convert.16d [concrete]
  148. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.16d, @Convert.2(%int_32) [concrete]
  149. // CHECK:STDOUT: %bound_method.8aa: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
  150. // CHECK:STDOUT: %int_0.263: %i32 = int_value 0 [concrete]
  151. // CHECK:STDOUT: %Convert.bound.43e: <bound method> = bound_method %int_1.5b8, %Convert.16d [concrete]
  152. // CHECK:STDOUT: %bound_method.947: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
  153. // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [concrete]
  154. // CHECK:STDOUT: %Base.val: %Base = struct_value (%int_0.263, %int_1.47b) [concrete]
  155. // CHECK:STDOUT: %Child.val: %Child = struct_value (%Base.val) [concrete]
  156. // CHECK:STDOUT: %Base.elem: type = unbound_element_type %Base, %i32 [concrete]
  157. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  158. // CHECK:STDOUT: %Convert.bound.918: <bound method> = bound_method %int_2.ecc, %Convert.16d [concrete]
  159. // CHECK:STDOUT: %bound_method.c74: <bound method> = bound_method %int_2.ecc, %Convert.specific_fn [concrete]
  160. // CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [concrete]
  161. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  162. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  163. // CHECK:STDOUT: }
  164. // CHECK:STDOUT:
  165. // CHECK:STDOUT: imports {
  166. // CHECK:STDOUT: %Main.Base = import_ref Main//a, Base, unloaded
  167. // CHECK:STDOUT: %Main.Child: type = import_ref Main//a, Child, loaded [concrete = constants.%Child]
  168. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  169. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  170. // CHECK:STDOUT: import Core//prelude
  171. // CHECK:STDOUT: import Core//prelude/...
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT: %Main.import_ref.239: <witness> = import_ref Main//a, loc10_1, loaded [concrete = constants.%complete_type.90f]
  174. // CHECK:STDOUT: %Main.import_ref.1f3 = import_ref Main//a, inst17 [no loc], unloaded
  175. // CHECK:STDOUT: %Main.import_ref.e8f: %F.type = import_ref Main//a, loc5_21, loaded [concrete = constants.%F]
  176. // CHECK:STDOUT: %Main.import_ref.8bf = import_ref Main//a, loc6_26, unloaded
  177. // CHECK:STDOUT: %Main.import_ref.e67: %Base.elem = import_ref Main//a, loc8_8, loaded [concrete = %.720]
  178. // CHECK:STDOUT: %Main.import_ref.2e4 = import_ref Main//a, loc9_13, unloaded
  179. // CHECK:STDOUT: %Main.import_ref.c5f: <witness> = import_ref Main//a, loc14_1, loaded [concrete = constants.%complete_type.15c]
  180. // CHECK:STDOUT: %Main.import_ref.9a9 = import_ref Main//a, inst77 [no loc], unloaded
  181. // CHECK:STDOUT: %Main.import_ref.7e5 = import_ref Main//a, loc13_20, unloaded
  182. // CHECK:STDOUT: %Main.import_ref.a21640.2: type = import_ref Main//a, loc13_16, loaded [concrete = constants.%Base]
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT:
  185. // CHECK:STDOUT: file {
  186. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  187. // CHECK:STDOUT: .Base = imports.%Main.Base
  188. // CHECK:STDOUT: .Child = imports.%Main.Child
  189. // CHECK:STDOUT: .Core = imports.%Core
  190. // CHECK:STDOUT: .Run = %Run.decl
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT: %Core.import = import Core
  193. // CHECK:STDOUT: %default.import = import <none>
  194. // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [concrete = constants.%Run] {} {}
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT:
  197. // CHECK:STDOUT: class @Child [from "a.carbon"] {
  198. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.c5f
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: !members:
  201. // CHECK:STDOUT: .Self = imports.%Main.import_ref.9a9
  202. // CHECK:STDOUT: .base = imports.%Main.import_ref.7e5
  203. // CHECK:STDOUT: .x = <poisoned>
  204. // CHECK:STDOUT: .F = <poisoned>
  205. // CHECK:STDOUT: extend imports.%Main.import_ref.a21640.2
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: class @Base [from "a.carbon"] {
  209. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.239
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: !members:
  212. // CHECK:STDOUT: .Self = imports.%Main.import_ref.1f3
  213. // CHECK:STDOUT: .F = imports.%Main.import_ref.e8f
  214. // CHECK:STDOUT: .Unused = imports.%Main.import_ref.8bf
  215. // CHECK:STDOUT: .x = imports.%Main.import_ref.e67
  216. // CHECK:STDOUT: .unused = imports.%Main.import_ref.2e4
  217. // CHECK:STDOUT: }
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: fn @Run() {
  220. // CHECK:STDOUT: !entry:
  221. // CHECK:STDOUT: name_binding_decl {
  222. // CHECK:STDOUT: %a.patt: %Child = binding_pattern a
  223. // CHECK:STDOUT: %.loc7_3.1: %Child = var_pattern %a.patt
  224. // CHECK:STDOUT: }
  225. // CHECK:STDOUT: %a.var: ref %Child = var a
  226. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  227. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  228. // CHECK:STDOUT: %.loc7_47.1: %struct_type.x.unused.c45 = struct_literal (%int_0, %int_1)
  229. // CHECK:STDOUT: %.loc7_48.1: %struct_type.base.6c7 = struct_literal (%.loc7_47.1)
  230. // CHECK:STDOUT: %impl.elem0.loc7_47.1: %.b14 = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d]
  231. // CHECK:STDOUT: %bound_method.loc7_47.1: <bound method> = bound_method %int_0, %impl.elem0.loc7_47.1 [concrete = constants.%Convert.bound.9aa]
  232. // CHECK:STDOUT: %specific_fn.loc7_47.1: <specific function> = specific_function %impl.elem0.loc7_47.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  233. // CHECK:STDOUT: %bound_method.loc7_47.2: <bound method> = bound_method %int_0, %specific_fn.loc7_47.1 [concrete = constants.%bound_method.8aa]
  234. // CHECK:STDOUT: %int.convert_checked.loc7_47.1: init %i32 = call %bound_method.loc7_47.2(%int_0) [concrete = constants.%int_0.263]
  235. // CHECK:STDOUT: %.loc7_47.2: init %i32 = converted %int_0, %int.convert_checked.loc7_47.1 [concrete = constants.%int_0.263]
  236. // CHECK:STDOUT: %.loc7_48.2: ref %Base = class_element_access %a.var, element0
  237. // CHECK:STDOUT: %.loc7_47.3: ref %i32 = class_element_access %.loc7_48.2, element0
  238. // CHECK:STDOUT: %.loc7_47.4: init %i32 = initialize_from %.loc7_47.2 to %.loc7_47.3 [concrete = constants.%int_0.263]
  239. // CHECK:STDOUT: %impl.elem0.loc7_47.2: %.b14 = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d]
  240. // CHECK:STDOUT: %bound_method.loc7_47.3: <bound method> = bound_method %int_1, %impl.elem0.loc7_47.2 [concrete = constants.%Convert.bound.43e]
  241. // CHECK:STDOUT: %specific_fn.loc7_47.2: <specific function> = specific_function %impl.elem0.loc7_47.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  242. // CHECK:STDOUT: %bound_method.loc7_47.4: <bound method> = bound_method %int_1, %specific_fn.loc7_47.2 [concrete = constants.%bound_method.947]
  243. // CHECK:STDOUT: %int.convert_checked.loc7_47.2: init %i32 = call %bound_method.loc7_47.4(%int_1) [concrete = constants.%int_1.47b]
  244. // CHECK:STDOUT: %.loc7_47.5: init %i32 = converted %int_1, %int.convert_checked.loc7_47.2 [concrete = constants.%int_1.47b]
  245. // CHECK:STDOUT: %.loc7_47.6: ref %i32 = class_element_access %.loc7_48.2, element1
  246. // CHECK:STDOUT: %.loc7_47.7: init %i32 = initialize_from %.loc7_47.5 to %.loc7_47.6 [concrete = constants.%int_1.47b]
  247. // CHECK:STDOUT: %.loc7_47.8: init %Base = class_init (%.loc7_47.4, %.loc7_47.7), %.loc7_48.2 [concrete = constants.%Base.val]
  248. // CHECK:STDOUT: %.loc7_48.3: init %Base = converted %.loc7_47.1, %.loc7_47.8 [concrete = constants.%Base.val]
  249. // CHECK:STDOUT: %.loc7_48.4: init %Child = class_init (%.loc7_48.3), %a.var [concrete = constants.%Child.val]
  250. // CHECK:STDOUT: %.loc7_3.2: init %Child = converted %.loc7_48.1, %.loc7_48.4 [concrete = constants.%Child.val]
  251. // CHECK:STDOUT: assign %a.var, %.loc7_3.2
  252. // CHECK:STDOUT: %Child.ref: type = name_ref Child, imports.%Main.Child [concrete = constants.%Child]
  253. // CHECK:STDOUT: %a: ref %Child = bind_name a, %a.var
  254. // CHECK:STDOUT: %a.ref.loc8: ref %Child = name_ref a, %a
  255. // CHECK:STDOUT: %x.ref: %Base.elem = name_ref x, imports.%Main.import_ref.e67 [concrete = imports.%.720]
  256. // CHECK:STDOUT: %.loc8_4.1: ref %Base = class_element_access %a.ref.loc8, element0
  257. // CHECK:STDOUT: %.loc8_4.2: ref %Base = converted %a.ref.loc8, %.loc8_4.1
  258. // CHECK:STDOUT: %.loc8_4.3: ref %i32 = class_element_access %.loc8_4.2, element0
  259. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  260. // CHECK:STDOUT: %impl.elem0.loc8: %.b14 = impl_witness_access constants.%impl_witness.b97, element0 [concrete = constants.%Convert.16d]
  261. // CHECK:STDOUT: %bound_method.loc8_7.1: <bound method> = bound_method %int_2, %impl.elem0.loc8 [concrete = constants.%Convert.bound.918]
  262. // CHECK:STDOUT: %specific_fn.loc8: <specific function> = specific_function %impl.elem0.loc8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  263. // CHECK:STDOUT: %bound_method.loc8_7.2: <bound method> = bound_method %int_2, %specific_fn.loc8 [concrete = constants.%bound_method.c74]
  264. // CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %bound_method.loc8_7.2(%int_2) [concrete = constants.%int_2.d0d]
  265. // CHECK:STDOUT: %.loc8_7: init %i32 = converted %int_2, %int.convert_checked.loc8 [concrete = constants.%int_2.d0d]
  266. // CHECK:STDOUT: assign %.loc8_4.3, %.loc8_7
  267. // CHECK:STDOUT: %a.ref.loc9: ref %Child = name_ref a, %a
  268. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Main.import_ref.e8f [concrete = constants.%F]
  269. // CHECK:STDOUT: %F.bound: <bound method> = bound_method %a.ref.loc9, %F.ref
  270. // CHECK:STDOUT: %.loc9_3.1: ref %Base = class_element_access %a.ref.loc9, element0
  271. // CHECK:STDOUT: %.loc9_3.2: ref %Base = converted %a.ref.loc9, %.loc9_3.1
  272. // CHECK:STDOUT: %.loc9_3.3: %Base = bind_value %.loc9_3.2
  273. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.bound(%.loc9_3.3)
  274. // CHECK:STDOUT: return
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT:
  277. // CHECK:STDOUT: fn @F[%self.param_patt: %Base]() [from "a.carbon"];
  278. // CHECK:STDOUT: