import.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/import.carbon
  10. // --- a.carbon
  11. library "[[@TEST_NAME]]";
  12. class Empty {
  13. }
  14. class Field {
  15. var x: i32;
  16. }
  17. class ForwardDeclared;
  18. class ForwardDeclared {
  19. fn F[self: Self]();
  20. fn G[addr self: Self*]();
  21. }
  22. class Incomplete;
  23. // --- b.carbon
  24. library "[[@TEST_NAME]]";
  25. import library "a";
  26. fn Run() {
  27. var a: Empty = {};
  28. var b: Field = {.x = 1};
  29. b.x = 2;
  30. var c: ForwardDeclared = {};
  31. c.F();
  32. c.G();
  33. var d: ForwardDeclared* = &c;
  34. var e: Incomplete*;
  35. }
  36. // CHECK:STDOUT: --- a.carbon
  37. // CHECK:STDOUT:
  38. // CHECK:STDOUT: constants {
  39. // CHECK:STDOUT: %Empty: type = class_type @Empty [template]
  40. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  41. // CHECK:STDOUT: %.2: <witness> = complete_type_witness %.1 [template]
  42. // CHECK:STDOUT: %Field: type = class_type @Field [template]
  43. // CHECK:STDOUT: %.3: Core.IntLiteral = int_value 32 [template]
  44. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  45. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  46. // CHECK:STDOUT: %i32: type = int_type signed, %.3 [template]
  47. // CHECK:STDOUT: %.4: type = unbound_element_type %Field, %i32 [template]
  48. // CHECK:STDOUT: %.5: type = struct_type {.x: %i32} [template]
  49. // CHECK:STDOUT: %.6: <witness> = complete_type_witness %.5 [template]
  50. // CHECK:STDOUT: %ForwardDeclared: type = class_type @ForwardDeclared [template]
  51. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  52. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  53. // CHECK:STDOUT: %.7: type = ptr_type %ForwardDeclared [template]
  54. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  55. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  56. // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template]
  57. // CHECK:STDOUT: }
  58. // CHECK:STDOUT:
  59. // CHECK:STDOUT: imports {
  60. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  61. // CHECK:STDOUT: .Int = %import_ref
  62. // CHECK:STDOUT: import Core//prelude
  63. // CHECK:STDOUT: import Core//prelude/...
  64. // CHECK:STDOUT: }
  65. // CHECK:STDOUT: }
  66. // CHECK:STDOUT:
  67. // CHECK:STDOUT: file {
  68. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  69. // CHECK:STDOUT: .Core = imports.%Core
  70. // CHECK:STDOUT: .Empty = %Empty.decl
  71. // CHECK:STDOUT: .Field = %Field.decl
  72. // CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl.loc11
  73. // CHECK:STDOUT: .Incomplete = %Incomplete.decl
  74. // CHECK:STDOUT: }
  75. // CHECK:STDOUT: %Core.import = import Core
  76. // CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} {}
  77. // CHECK:STDOUT: %Field.decl: type = class_decl @Field [template = constants.%Field] {} {}
  78. // CHECK:STDOUT: %ForwardDeclared.decl.loc11: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} {}
  79. // CHECK:STDOUT: %ForwardDeclared.decl.loc13: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} {}
  80. // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {}
  81. // CHECK:STDOUT: }
  82. // CHECK:STDOUT:
  83. // CHECK:STDOUT: class @Empty {
  84. // CHECK:STDOUT: %.loc5: <witness> = complete_type_witness %.1 [template = constants.%.2]
  85. // CHECK:STDOUT:
  86. // CHECK:STDOUT: !members:
  87. // CHECK:STDOUT: .Self = constants.%Empty
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT:
  90. // CHECK:STDOUT: class @Field {
  91. // CHECK:STDOUT: %.loc8_10.1: Core.IntLiteral = int_value 32 [template = constants.%.3]
  92. // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc8_10.1) [template = constants.%i32]
  93. // CHECK:STDOUT: %.loc8_10.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
  94. // CHECK:STDOUT: %.loc8_10.3: type = converted %int.make_type_signed, %.loc8_10.2 [template = constants.%i32]
  95. // CHECK:STDOUT: %.loc8_8: %.4 = field_decl x, element0 [template]
  96. // CHECK:STDOUT: %.loc9: <witness> = complete_type_witness %.5 [template = constants.%.6]
  97. // CHECK:STDOUT:
  98. // CHECK:STDOUT: !members:
  99. // CHECK:STDOUT: .Self = constants.%Field
  100. // CHECK:STDOUT: .x = %.loc8_8
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT:
  103. // CHECK:STDOUT: class @ForwardDeclared {
  104. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  105. // CHECK:STDOUT: %self.patt: %ForwardDeclared = binding_pattern self
  106. // CHECK:STDOUT: %self.param_patt: %ForwardDeclared = value_param_pattern %self.patt, runtime_param0
  107. // CHECK:STDOUT: } {
  108. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared]
  109. // CHECK:STDOUT: %self.param: %ForwardDeclared = value_param runtime_param0
  110. // CHECK:STDOUT: %self: %ForwardDeclared = bind_name self, %self.param
  111. // CHECK:STDOUT: }
  112. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  113. // CHECK:STDOUT: %self.patt: %.7 = binding_pattern self
  114. // CHECK:STDOUT: %self.param_patt: %.7 = value_param_pattern %self.patt, runtime_param0
  115. // CHECK:STDOUT: %.loc15_8: auto = addr_pattern %self.param_patt
  116. // CHECK:STDOUT: } {
  117. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%ForwardDeclared [template = constants.%ForwardDeclared]
  118. // CHECK:STDOUT: %.loc15_23: type = ptr_type %ForwardDeclared [template = constants.%.7]
  119. // CHECK:STDOUT: %self.param: %.7 = value_param runtime_param0
  120. // CHECK:STDOUT: %self: %.7 = bind_name self, %self.param
  121. // CHECK:STDOUT: }
  122. // CHECK:STDOUT: %.loc16: <witness> = complete_type_witness %.1 [template = constants.%.2]
  123. // CHECK:STDOUT:
  124. // CHECK:STDOUT: !members:
  125. // CHECK:STDOUT: .Self = constants.%ForwardDeclared
  126. // CHECK:STDOUT: .F = %F.decl
  127. // CHECK:STDOUT: .G = %G.decl
  128. // CHECK:STDOUT: }
  129. // CHECK:STDOUT:
  130. // CHECK:STDOUT: class @Incomplete;
  131. // CHECK:STDOUT:
  132. // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared]();
  133. // CHECK:STDOUT:
  134. // CHECK:STDOUT: fn @G[addr %self.param_patt: %.7]();
  135. // CHECK:STDOUT:
  136. // CHECK:STDOUT: --- b.carbon
  137. // CHECK:STDOUT:
  138. // CHECK:STDOUT: constants {
  139. // CHECK:STDOUT: %Run.type: type = fn_type @Run [template]
  140. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  141. // CHECK:STDOUT: %Run: %Run.type = struct_value () [template]
  142. // CHECK:STDOUT: %Empty: type = class_type @Empty [template]
  143. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  144. // CHECK:STDOUT: %struct.1: %Empty = struct_value () [template]
  145. // CHECK:STDOUT: %Field: type = class_type @Field [template]
  146. // CHECK:STDOUT: %.4: Core.IntLiteral = int_value 32 [template]
  147. // CHECK:STDOUT: %i32: type = int_type signed, %.4 [template]
  148. // CHECK:STDOUT: %.8: Core.IntLiteral = int_value 1 [template]
  149. // CHECK:STDOUT: %.9: type = struct_type {.x: Core.IntLiteral} [template]
  150. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  151. // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.4) [template]
  152. // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
  153. // CHECK:STDOUT: %.29: <witness> = interface_witness (%Convert.14) [template]
  154. // CHECK:STDOUT: %.30: <bound method> = bound_method %.8, %Convert.14 [template]
  155. // CHECK:STDOUT: %.31: <specific function> = specific_function %.30, @Convert.2(%.4) [template]
  156. // CHECK:STDOUT: %.32: %i32 = int_value 1 [template]
  157. // CHECK:STDOUT: %struct.2: %Field = struct_value (%.32) [template]
  158. // CHECK:STDOUT: %.33: type = unbound_element_type %Field, %i32 [template]
  159. // CHECK:STDOUT: %.34: Core.IntLiteral = int_value 2 [template]
  160. // CHECK:STDOUT: %.35: <bound method> = bound_method %.34, %Convert.14 [template]
  161. // CHECK:STDOUT: %.36: <specific function> = specific_function %.35, @Convert.2(%.4) [template]
  162. // CHECK:STDOUT: %.37: %i32 = int_value 2 [template]
  163. // CHECK:STDOUT: %ForwardDeclared.1: type = class_type @ForwardDeclared.1 [template]
  164. // CHECK:STDOUT: %struct.3: %ForwardDeclared.1 = struct_value () [template]
  165. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  166. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  167. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  168. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  169. // CHECK:STDOUT: %.38: type = ptr_type %ForwardDeclared.1 [template]
  170. // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template]
  171. // CHECK:STDOUT: %.39: type = ptr_type %Incomplete [template]
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT:
  174. // CHECK:STDOUT: imports {
  175. // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Empty]
  176. // CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+8, loaded [template = constants.%Field]
  177. // CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+33, loaded [template = constants.%ForwardDeclared.1]
  178. // CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+56, loaded [template = constants.%Incomplete]
  179. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  180. // CHECK:STDOUT: .ImplicitAs = %import_ref.8
  181. // CHECK:STDOUT: import Core//prelude
  182. // CHECK:STDOUT: import Core//prelude/...
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded
  185. // CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+9, unloaded
  186. // CHECK:STDOUT: %import_ref.7: %.33 = import_ref Main//a, inst+29, loaded [template = %.1]
  187. // CHECK:STDOUT: %import_ref.44 = import_ref Main//a, inst+34, unloaded
  188. // CHECK:STDOUT: %import_ref.45: %F.type = import_ref Main//a, inst+41, loaded [template = constants.%F]
  189. // CHECK:STDOUT: %import_ref.46: %G.type = import_ref Main//a, inst+52, loaded [template = constants.%G]
  190. // CHECK:STDOUT: %import_ref.47 = import_ref Main//a, inst+34, unloaded
  191. // CHECK:STDOUT: %import_ref.48 = import_ref Main//a, inst+41, unloaded
  192. // CHECK:STDOUT: %import_ref.49 = import_ref Main//a, inst+52, unloaded
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: file {
  196. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  197. // CHECK:STDOUT: .Empty = imports.%import_ref.1
  198. // CHECK:STDOUT: .Field = imports.%import_ref.2
  199. // CHECK:STDOUT: .ForwardDeclared = imports.%import_ref.3
  200. // CHECK:STDOUT: .Incomplete = imports.%import_ref.4
  201. // CHECK:STDOUT: .Core = imports.%Core
  202. // CHECK:STDOUT: .Run = %Run.decl
  203. // CHECK:STDOUT: }
  204. // CHECK:STDOUT: %Core.import = import Core
  205. // CHECK:STDOUT: %default.import = import <invalid>
  206. // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} {}
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: class @Empty {
  210. // CHECK:STDOUT: !members:
  211. // CHECK:STDOUT: .Self = imports.%import_ref.5
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT:
  214. // CHECK:STDOUT: class @Field {
  215. // CHECK:STDOUT: !members:
  216. // CHECK:STDOUT: .Self = imports.%import_ref.6
  217. // CHECK:STDOUT: .x = imports.%import_ref.7
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: class @ForwardDeclared.1 {
  221. // CHECK:STDOUT: !members:
  222. // CHECK:STDOUT: .Self = imports.%import_ref.44
  223. // CHECK:STDOUT: .F = imports.%import_ref.45
  224. // CHECK:STDOUT: .G = imports.%import_ref.46
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: class @ForwardDeclared.2 {
  228. // CHECK:STDOUT: !members:
  229. // CHECK:STDOUT: .Self = imports.%import_ref.47
  230. // CHECK:STDOUT: .F = imports.%import_ref.48
  231. // CHECK:STDOUT: .G = imports.%import_ref.49
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT:
  234. // CHECK:STDOUT: class @Incomplete;
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: fn @Run() {
  237. // CHECK:STDOUT: !entry:
  238. // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, imports.%import_ref.1 [template = constants.%Empty]
  239. // CHECK:STDOUT: %a.var: ref %Empty = var a
  240. // CHECK:STDOUT: %a: ref %Empty = bind_name a, %a.var
  241. // CHECK:STDOUT: %.loc7_19.1: %.1 = struct_literal ()
  242. // CHECK:STDOUT: %.loc7_19.2: init %Empty = class_init (), %a.var [template = constants.%struct.1]
  243. // CHECK:STDOUT: %.loc7_20: init %Empty = converted %.loc7_19.1, %.loc7_19.2 [template = constants.%struct.1]
  244. // CHECK:STDOUT: assign %a.var, %.loc7_20
  245. // CHECK:STDOUT: %Field.ref: type = name_ref Field, imports.%import_ref.2 [template = constants.%Field]
  246. // CHECK:STDOUT: %b.var: ref %Field = var b
  247. // CHECK:STDOUT: %b: ref %Field = bind_name b, %b.var
  248. // CHECK:STDOUT: %.loc9_24: Core.IntLiteral = int_value 1 [template = constants.%.8]
  249. // CHECK:STDOUT: %.loc9_25.1: %.9 = struct_literal (%.loc9_24)
  250. // CHECK:STDOUT: %.loc9_25.2: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14]
  251. // CHECK:STDOUT: %.loc9_25.3: <bound method> = bound_method %.loc9_24, %.loc9_25.2 [template = constants.%.30]
  252. // CHECK:STDOUT: %.loc9_25.4: <specific function> = specific_function %.loc9_25.3, @Convert.2(constants.%.4) [template = constants.%.31]
  253. // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %.loc9_25.4(%.loc9_24) [template = constants.%.32]
  254. // CHECK:STDOUT: %.loc9_25.5: init %i32 = converted %.loc9_24, %int.convert_checked.loc9 [template = constants.%.32]
  255. // CHECK:STDOUT: %.loc9_25.6: ref %i32 = class_element_access %b.var, element0
  256. // CHECK:STDOUT: %.loc9_25.7: init %i32 = initialize_from %.loc9_25.5 to %.loc9_25.6 [template = constants.%.32]
  257. // CHECK:STDOUT: %.loc9_25.8: init %Field = class_init (%.loc9_25.7), %b.var [template = constants.%struct.2]
  258. // CHECK:STDOUT: %.loc9_26: init %Field = converted %.loc9_25.1, %.loc9_25.8 [template = constants.%struct.2]
  259. // CHECK:STDOUT: assign %b.var, %.loc9_26
  260. // CHECK:STDOUT: %b.ref: ref %Field = name_ref b, %b
  261. // CHECK:STDOUT: %x.ref: %.33 = name_ref x, imports.%import_ref.7 [template = imports.%.1]
  262. // CHECK:STDOUT: %.loc10_4: ref %i32 = class_element_access %b.ref, element0
  263. // CHECK:STDOUT: %.loc10_9: Core.IntLiteral = int_value 2 [template = constants.%.34]
  264. // CHECK:STDOUT: %.loc10_7.1: %Convert.type.2 = interface_witness_access constants.%.29, element0 [template = constants.%Convert.14]
  265. // CHECK:STDOUT: %.loc10_7.2: <bound method> = bound_method %.loc10_9, %.loc10_7.1 [template = constants.%.35]
  266. // CHECK:STDOUT: %.loc10_7.3: <specific function> = specific_function %.loc10_7.2, @Convert.2(constants.%.4) [template = constants.%.36]
  267. // CHECK:STDOUT: %int.convert_checked.loc10: init %i32 = call %.loc10_7.3(%.loc10_9) [template = constants.%.37]
  268. // CHECK:STDOUT: %.loc10_7.4: init %i32 = converted %.loc10_9, %int.convert_checked.loc10 [template = constants.%.37]
  269. // CHECK:STDOUT: assign %.loc10_4, %.loc10_7.4
  270. // CHECK:STDOUT: %ForwardDeclared.ref.loc12: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1]
  271. // CHECK:STDOUT: %c.var: ref %ForwardDeclared.1 = var c
  272. // CHECK:STDOUT: %c: ref %ForwardDeclared.1 = bind_name c, %c.var
  273. // CHECK:STDOUT: %.loc12_29.1: %.1 = struct_literal ()
  274. // CHECK:STDOUT: %.loc12_29.2: init %ForwardDeclared.1 = class_init (), %c.var [template = constants.%struct.3]
  275. // CHECK:STDOUT: %.loc12_30: init %ForwardDeclared.1 = converted %.loc12_29.1, %.loc12_29.2 [template = constants.%struct.3]
  276. // CHECK:STDOUT: assign %c.var, %.loc12_30
  277. // CHECK:STDOUT: %c.ref.loc13: ref %ForwardDeclared.1 = name_ref c, %c
  278. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.45 [template = constants.%F]
  279. // CHECK:STDOUT: %.loc13_4: <bound method> = bound_method %c.ref.loc13, %F.ref
  280. // CHECK:STDOUT: %.loc13_3: %ForwardDeclared.1 = bind_value %c.ref.loc13
  281. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %.loc13_4(%.loc13_3)
  282. // CHECK:STDOUT: %c.ref.loc14: ref %ForwardDeclared.1 = name_ref c, %c
  283. // CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.46 [template = constants.%G]
  284. // CHECK:STDOUT: %.loc14_4: <bound method> = bound_method %c.ref.loc14, %G.ref
  285. // CHECK:STDOUT: %.loc14_3: %.38 = addr_of %c.ref.loc14
  286. // CHECK:STDOUT: %G.call: init %empty_tuple.type = call %.loc14_4(%.loc14_3)
  287. // CHECK:STDOUT: %ForwardDeclared.ref.loc16: type = name_ref ForwardDeclared, imports.%import_ref.3 [template = constants.%ForwardDeclared.1]
  288. // CHECK:STDOUT: %.loc16_25: type = ptr_type %ForwardDeclared.1 [template = constants.%.38]
  289. // CHECK:STDOUT: %d.var: ref %.38 = var d
  290. // CHECK:STDOUT: %d: ref %.38 = bind_name d, %d.var
  291. // CHECK:STDOUT: %c.ref.loc16: ref %ForwardDeclared.1 = name_ref c, %c
  292. // CHECK:STDOUT: %.loc16_29: %.38 = addr_of %c.ref.loc16
  293. // CHECK:STDOUT: assign %d.var, %.loc16_29
  294. // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.4 [template = constants.%Incomplete]
  295. // CHECK:STDOUT: %.loc18: type = ptr_type %Incomplete [template = constants.%.39]
  296. // CHECK:STDOUT: %e.var: ref %.39 = var e
  297. // CHECK:STDOUT: %e: ref %.39 = bind_name e, %e.var
  298. // CHECK:STDOUT: return
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: fn @F[%self.param_patt: %ForwardDeclared.1]();
  302. // CHECK:STDOUT:
  303. // CHECK:STDOUT: fn @G[addr <unexpected>.inst+437: %.38]();
  304. // CHECK:STDOUT: