compile_time_bindings.carbon 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // This is mostly checking against crashes for compile time bindings in
  10. // difficult contexts.
  11. //
  12. // AUTOUPDATE
  13. // TIP: To test this file alone, run:
  14. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/let/compile_time_bindings.carbon
  15. // TIP: To dump output, run:
  16. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/compile_time_bindings.carbon
  17. // --- fail_let_after.carbon
  18. library "[[@TEST_NAME]]";
  19. class C {
  20. fn F() -> () { return x; }
  21. // CHECK:STDERR: fail_let_after.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
  22. // CHECK:STDERR: let x:! () = ();
  23. // CHECK:STDERR: ^~~~~~
  24. // CHECK:STDERR:
  25. let x:! () = ();
  26. }
  27. // --- fail_let_before.carbon
  28. library "[[@TEST_NAME]]";
  29. class C {
  30. // CHECK:STDERR: fail_let_before.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
  31. // CHECK:STDERR: let x:! () = ();
  32. // CHECK:STDERR: ^~~~~~
  33. // CHECK:STDERR:
  34. let x:! () = ();
  35. fn F() -> () { return x; }
  36. }
  37. // --- fail_multiple_lets.carbon
  38. library "[[@TEST_NAME]]";
  39. class C {
  40. // CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
  41. // CHECK:STDERR: let a:! () = ();
  42. // CHECK:STDERR: ^~~~~~
  43. // CHECK:STDERR:
  44. let a:! () = ();
  45. fn F(b:! ((),)) {
  46. let c:! ((), ()) = ((), ());
  47. var a1: () = a;
  48. var b1: ((),) = b;
  49. var c1: ((), ()) = c;
  50. var d1: ((), (), ()) = d;
  51. }
  52. // CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
  53. // CHECK:STDERR: let d:! ((), (), ()) = ((), (), ());
  54. // CHECK:STDERR: ^~~~~~~~~~~~~~~~
  55. // CHECK:STDERR:
  56. let d:! ((), (), ()) = ((), (), ());
  57. }
  58. // --- fail_invalid_let_after.carbon
  59. library "[[@TEST_NAME]]";
  60. class C {
  61. fn F() -> () { return x; }
  62. // CHECK:STDERR: fail_invalid_let_after.carbon:[[@LINE+8]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
  63. // CHECK:STDERR: let x:! ();
  64. // CHECK:STDERR: ^~~~~~
  65. // CHECK:STDERR:
  66. // CHECK:STDERR: fail_invalid_let_after.carbon:[[@LINE+4]]:13: error: expected `=`; `let` declaration must have an initializer [ExpectedInitializerAfterLet]
  67. // CHECK:STDERR: let x:! ();
  68. // CHECK:STDERR: ^
  69. // CHECK:STDERR:
  70. let x:! ();
  71. }
  72. // --- use_in_function.carbon
  73. library "[[@TEST_NAME]]";
  74. fn F() -> i32 {
  75. let Zero:! i32 = 0;
  76. return Zero;
  77. }
  78. // --- use_in_block.carbon
  79. library "[[@TEST_NAME]]";
  80. fn F() -> i32 {
  81. if (true) {
  82. let Zero:! i32 = 0;
  83. return Zero;
  84. }
  85. return 1;
  86. }
  87. // --- return_in_interface.carbon
  88. library "[[@TEST_NAME]]";
  89. interface I {
  90. let T:! type = i32;
  91. fn F() -> T;
  92. }
  93. // --- fail_return_in_class.carbon
  94. library "[[@TEST_NAME]]";
  95. class I {
  96. // CHECK:STDERR: fail_return_in_class.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
  97. // CHECK:STDERR: let T:! type = i32;
  98. // CHECK:STDERR: ^~~~~~~~
  99. // CHECK:STDERR:
  100. let T:! type = i32;
  101. // CHECK:STDERR: fail_return_in_class.carbon:[[@LINE+4]]:13: error: cannot evaluate type expression [TypeExprEvaluationFailure]
  102. // CHECK:STDERR: fn F() -> T;
  103. // CHECK:STDERR: ^
  104. // CHECK:STDERR:
  105. fn F() -> T;
  106. }
  107. // --- fail_return_in_package_scope.carbon
  108. library "[[@TEST_NAME]]";
  109. // CHECK:STDERR: fail_return_in_package_scope.carbon:[[@LINE+4]]:5: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
  110. // CHECK:STDERR: let T:! type = i32;
  111. // CHECK:STDERR: ^~~~~~~~
  112. // CHECK:STDERR:
  113. let T:! type = i32;
  114. // CHECK:STDERR: fail_return_in_package_scope.carbon:[[@LINE+4]]:11: error: cannot evaluate type expression [TypeExprEvaluationFailure]
  115. // CHECK:STDERR: fn F() -> T;
  116. // CHECK:STDERR: ^
  117. // CHECK:STDERR:
  118. fn F() -> T;
  119. // --- fail_use_in_impl.carbon
  120. library "[[@TEST_NAME]]";
  121. interface Empty {}
  122. impl i32 as Empty {
  123. // CHECK:STDERR: fail_use_in_impl.carbon:[[@LINE+4]]:7: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
  124. // CHECK:STDERR: let Zero:! i32 = 0;
  125. // CHECK:STDERR: ^~~~~~~~~~
  126. // CHECK:STDERR:
  127. let Zero:! i32 = 0;
  128. }
  129. // CHECK:STDOUT: --- fail_let_after.carbon
  130. // CHECK:STDOUT:
  131. // CHECK:STDOUT: constants {
  132. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  133. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  134. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
  135. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  136. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  137. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  138. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  139. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  140. // CHECK:STDOUT: }
  141. // CHECK:STDOUT:
  142. // CHECK:STDOUT: imports {
  143. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  144. // CHECK:STDOUT: import Core//prelude
  145. // CHECK:STDOUT: import Core//prelude/...
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: file {
  150. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  151. // CHECK:STDOUT: .Core = imports.%Core
  152. // CHECK:STDOUT: .C = %C.decl
  153. // CHECK:STDOUT: }
  154. // CHECK:STDOUT: %Core.import = import Core
  155. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  156. // CHECK:STDOUT: }
  157. // CHECK:STDOUT:
  158. // CHECK:STDOUT: class @C {
  159. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  160. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  161. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  162. // CHECK:STDOUT: } {
  163. // CHECK:STDOUT: %.loc5_14.1: %empty_tuple.type = tuple_literal ()
  164. // CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  165. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
  166. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT: name_binding_decl {
  169. // CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
  170. // CHECK:STDOUT: }
  171. // CHECK:STDOUT: %.loc10_17.1: %empty_tuple.type = tuple_literal ()
  172. // CHECK:STDOUT: %.loc10_12.1: type = splice_block %.loc10_12.3 [concrete = constants.%empty_tuple.type] {
  173. // CHECK:STDOUT: %.loc10_12.2: %empty_tuple.type = tuple_literal ()
  174. // CHECK:STDOUT: %.loc10_12.3: type = converted %.loc10_12.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  175. // CHECK:STDOUT: }
  176. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  177. // CHECK:STDOUT: %.loc10_17.2: %empty_tuple.type = converted %.loc10_17.1, %empty_tuple [concrete = constants.%empty_tuple]
  178. // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %.loc10_17.2
  179. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  180. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  181. // CHECK:STDOUT: complete_type_witness = %complete_type
  182. // CHECK:STDOUT:
  183. // CHECK:STDOUT: !members:
  184. // CHECK:STDOUT: .Self = constants.%C
  185. // CHECK:STDOUT: .F = %F.decl
  186. // CHECK:STDOUT: .x = %x
  187. // CHECK:STDOUT: }
  188. // CHECK:STDOUT:
  189. // CHECK:STDOUT: fn @F() -> %empty_tuple.type {
  190. // CHECK:STDOUT: !entry:
  191. // CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, @C.%x
  192. // CHECK:STDOUT: return %x.ref
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: --- fail_let_before.carbon
  196. // CHECK:STDOUT:
  197. // CHECK:STDOUT: constants {
  198. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  199. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  200. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
  201. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  202. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  203. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  204. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  205. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  206. // CHECK:STDOUT: }
  207. // CHECK:STDOUT:
  208. // CHECK:STDOUT: imports {
  209. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  210. // CHECK:STDOUT: import Core//prelude
  211. // CHECK:STDOUT: import Core//prelude/...
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT:
  215. // CHECK:STDOUT: file {
  216. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  217. // CHECK:STDOUT: .Core = imports.%Core
  218. // CHECK:STDOUT: .C = %C.decl
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT: %Core.import = import Core
  221. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: class @C {
  225. // CHECK:STDOUT: name_binding_decl {
  226. // CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT: %.loc9_17.1: %empty_tuple.type = tuple_literal ()
  229. // CHECK:STDOUT: %.loc9_12.1: type = splice_block %.loc9_12.3 [concrete = constants.%empty_tuple.type] {
  230. // CHECK:STDOUT: %.loc9_12.2: %empty_tuple.type = tuple_literal ()
  231. // CHECK:STDOUT: %.loc9_12.3: type = converted %.loc9_12.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  234. // CHECK:STDOUT: %.loc9_17.2: %empty_tuple.type = converted %.loc9_17.1, %empty_tuple [concrete = constants.%empty_tuple]
  235. // CHECK:STDOUT: %x: %empty_tuple.type = bind_name x, %.loc9_17.2
  236. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  237. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  238. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  239. // CHECK:STDOUT: } {
  240. // CHECK:STDOUT: %.loc10_14.1: %empty_tuple.type = tuple_literal ()
  241. // CHECK:STDOUT: %.loc10_14.2: type = converted %.loc10_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  242. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
  243. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  244. // CHECK:STDOUT: }
  245. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  246. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  247. // CHECK:STDOUT: complete_type_witness = %complete_type
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: !members:
  250. // CHECK:STDOUT: .Self = constants.%C
  251. // CHECK:STDOUT: .x = %x
  252. // CHECK:STDOUT: .F = %F.decl
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: fn @F() -> %empty_tuple.type {
  256. // CHECK:STDOUT: !entry:
  257. // CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, @C.%x
  258. // CHECK:STDOUT: return %x.ref
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: --- fail_multiple_lets.carbon
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: constants {
  264. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  265. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  266. // CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
  267. // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
  268. // CHECK:STDOUT: %tuple.type.9fb: type = tuple_type (%empty_tuple.type) [concrete]
  269. // CHECK:STDOUT: %b: %tuple.type.9fb = bind_symbolic_name b, 0 [symbolic]
  270. // CHECK:STDOUT: %pattern_type.559: type = pattern_type %tuple.type.9fb [concrete]
  271. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  272. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  273. // CHECK:STDOUT: %tuple.type.2d5: type = tuple_type (%empty_tuple.type, %empty_tuple.type, %empty_tuple.type) [concrete]
  274. // CHECK:STDOUT: %ptr.7fe: type = ptr_type %tuple.type.2d5 [concrete]
  275. // CHECK:STDOUT: %pattern_type.8c1: type = pattern_type %tuple.type.2d5 [concrete]
  276. // CHECK:STDOUT: %tuple.7e4: %tuple.type.2d5 = tuple_value (%empty_tuple, %empty_tuple, %empty_tuple) [concrete]
  277. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  278. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  279. // CHECK:STDOUT: %tuple.type.bcd: type = tuple_type (%empty_tuple.type, %empty_tuple.type) [concrete]
  280. // CHECK:STDOUT: %ptr.709: type = ptr_type %tuple.type.bcd [concrete]
  281. // CHECK:STDOUT: %c: %tuple.type.bcd = bind_symbolic_name c, 1 [symbolic]
  282. // CHECK:STDOUT: %pattern_type.5b8: type = pattern_type %tuple.type.bcd [concrete]
  283. // CHECK:STDOUT: %tuple.d8f: %tuple.type.bcd = tuple_value (%empty_tuple, %empty_tuple) [concrete]
  284. // CHECK:STDOUT: %tuple.elem0.af8: %empty_tuple.type = tuple_access %b, element0 [symbolic]
  285. // CHECK:STDOUT: %tuple.f41: %tuple.type.9fb = tuple_value (%empty_tuple) [concrete]
  286. // CHECK:STDOUT: %tuple.elem0.eaf: %empty_tuple.type = tuple_access %c, element0 [symbolic]
  287. // CHECK:STDOUT: %tuple.elem1: %empty_tuple.type = tuple_access %c, element1 [symbolic]
  288. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  289. // CHECK:STDOUT: %Op.type.073: type = fn_type @Op.2, @impl(%tuple.type.2d5) [concrete]
  290. // CHECK:STDOUT: %Op.dce: %Op.type.073 = struct_value () [concrete]
  291. // CHECK:STDOUT: %Op.specific_fn.234: <specific function> = specific_function %Op.dce, @Op.2(%tuple.type.2d5) [concrete]
  292. // CHECK:STDOUT: %Op.type.4e8: type = fn_type @Op.2, @impl(%tuple.type.bcd) [concrete]
  293. // CHECK:STDOUT: %Op.166: %Op.type.4e8 = struct_value () [concrete]
  294. // CHECK:STDOUT: %Op.specific_fn.48a: <specific function> = specific_function %Op.166, @Op.2(%tuple.type.bcd) [concrete]
  295. // CHECK:STDOUT: %Op.type.23e: type = fn_type @Op.2, @impl(%tuple.type.9fb) [concrete]
  296. // CHECK:STDOUT: %Op.f19: %Op.type.23e = struct_value () [concrete]
  297. // CHECK:STDOUT: %ptr.652: type = ptr_type %tuple.type.9fb [concrete]
  298. // CHECK:STDOUT: %Op.specific_fn.d2b: <specific function> = specific_function %Op.f19, @Op.2(%tuple.type.9fb) [concrete]
  299. // CHECK:STDOUT: %Op.type.a63: type = fn_type @Op.2, @impl(%empty_tuple.type) [concrete]
  300. // CHECK:STDOUT: %Op.ea3: %Op.type.a63 = struct_value () [concrete]
  301. // CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete]
  302. // CHECK:STDOUT: %Op.specific_fn.393: <specific function> = specific_function %Op.ea3, @Op.2(%empty_tuple.type) [concrete]
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT:
  305. // CHECK:STDOUT: imports {
  306. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  307. // CHECK:STDOUT: .Destroy = %Core.Destroy
  308. // CHECK:STDOUT: import Core//prelude
  309. // CHECK:STDOUT: import Core//prelude/...
  310. // CHECK:STDOUT: }
  311. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  312. // CHECK:STDOUT: }
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: file {
  315. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  316. // CHECK:STDOUT: .Core = imports.%Core
  317. // CHECK:STDOUT: .C = %C.decl
  318. // CHECK:STDOUT: }
  319. // CHECK:STDOUT: %Core.import = import Core
  320. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: class @C {
  324. // CHECK:STDOUT: name_binding_decl {
  325. // CHECK:STDOUT: %a.patt: %pattern_type.cb1 = binding_pattern a [concrete]
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT: %.loc9_17.1: %empty_tuple.type = tuple_literal ()
  328. // CHECK:STDOUT: %.loc9_12.1: type = splice_block %.loc9_12.3 [concrete = constants.%empty_tuple.type] {
  329. // CHECK:STDOUT: %.loc9_12.2: %empty_tuple.type = tuple_literal ()
  330. // CHECK:STDOUT: %.loc9_12.3: type = converted %.loc9_12.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  331. // CHECK:STDOUT: }
  332. // CHECK:STDOUT: %empty_tuple.loc9: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  333. // CHECK:STDOUT: %.loc9_17.2: %empty_tuple.type = converted %.loc9_17.1, %empty_tuple.loc9 [concrete = constants.%empty_tuple]
  334. // CHECK:STDOUT: %a: %empty_tuple.type = bind_name a, %.loc9_17.2
  335. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  336. // CHECK:STDOUT: %b.patt: %pattern_type.559 = symbolic_binding_pattern b, 0 [concrete]
  337. // CHECK:STDOUT: } {
  338. // CHECK:STDOUT: %.loc10_16.1: type = splice_block %.loc10_16.4 [concrete = constants.%tuple.type.9fb] {
  339. // CHECK:STDOUT: %.loc10_14: %empty_tuple.type = tuple_literal ()
  340. // CHECK:STDOUT: %.loc10_16.2: %tuple.type.9fb = tuple_literal (%.loc10_14)
  341. // CHECK:STDOUT: %.loc10_16.3: type = converted %.loc10_14, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  342. // CHECK:STDOUT: %.loc10_16.4: type = converted %.loc10_16.2, constants.%tuple.type.9fb [concrete = constants.%tuple.type.9fb]
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT: %b.loc10_8.2: %tuple.type.9fb = bind_symbolic_name b, 0 [symbolic = %b.loc10_8.1 (constants.%b)]
  345. // CHECK:STDOUT: }
  346. // CHECK:STDOUT: name_binding_decl {
  347. // CHECK:STDOUT: %d.patt: %pattern_type.8c1 = binding_pattern d [concrete]
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT: %.loc22_28: %empty_tuple.type = tuple_literal ()
  350. // CHECK:STDOUT: %.loc22_32: %empty_tuple.type = tuple_literal ()
  351. // CHECK:STDOUT: %.loc22_36: %empty_tuple.type = tuple_literal ()
  352. // CHECK:STDOUT: %.loc22_37.1: %tuple.type.2d5 = tuple_literal (%.loc22_28, %.loc22_32, %.loc22_36)
  353. // CHECK:STDOUT: %.loc22_22.1: type = splice_block %.loc22_22.6 [concrete = constants.%tuple.type.2d5] {
  354. // CHECK:STDOUT: %.loc22_13: %empty_tuple.type = tuple_literal ()
  355. // CHECK:STDOUT: %.loc22_17: %empty_tuple.type = tuple_literal ()
  356. // CHECK:STDOUT: %.loc22_21: %empty_tuple.type = tuple_literal ()
  357. // CHECK:STDOUT: %.loc22_22.2: %tuple.type.2d5 = tuple_literal (%.loc22_13, %.loc22_17, %.loc22_21)
  358. // CHECK:STDOUT: %.loc22_22.3: type = converted %.loc22_13, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  359. // CHECK:STDOUT: %.loc22_22.4: type = converted %.loc22_17, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  360. // CHECK:STDOUT: %.loc22_22.5: type = converted %.loc22_21, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  361. // CHECK:STDOUT: %.loc22_22.6: type = converted %.loc22_22.2, constants.%tuple.type.2d5 [concrete = constants.%tuple.type.2d5]
  362. // CHECK:STDOUT: }
  363. // CHECK:STDOUT: %empty_tuple.loc22_28: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  364. // CHECK:STDOUT: %.loc22_37.2: %empty_tuple.type = converted %.loc22_28, %empty_tuple.loc22_28 [concrete = constants.%empty_tuple]
  365. // CHECK:STDOUT: %empty_tuple.loc22_32: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  366. // CHECK:STDOUT: %.loc22_37.3: %empty_tuple.type = converted %.loc22_32, %empty_tuple.loc22_32 [concrete = constants.%empty_tuple]
  367. // CHECK:STDOUT: %empty_tuple.loc22_36: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  368. // CHECK:STDOUT: %.loc22_37.4: %empty_tuple.type = converted %.loc22_36, %empty_tuple.loc22_36 [concrete = constants.%empty_tuple]
  369. // CHECK:STDOUT: %tuple: %tuple.type.2d5 = tuple_value (%.loc22_37.2, %.loc22_37.3, %.loc22_37.4) [concrete = constants.%tuple.7e4]
  370. // CHECK:STDOUT: %.loc22_37.5: %tuple.type.2d5 = converted %.loc22_37.1, %tuple [concrete = constants.%tuple.7e4]
  371. // CHECK:STDOUT: %d: %tuple.type.2d5 = bind_name d, %.loc22_37.5
  372. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  373. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  374. // CHECK:STDOUT: complete_type_witness = %complete_type
  375. // CHECK:STDOUT:
  376. // CHECK:STDOUT: !members:
  377. // CHECK:STDOUT: .Self = constants.%C
  378. // CHECK:STDOUT: .a = %a
  379. // CHECK:STDOUT: .F = %F.decl
  380. // CHECK:STDOUT: .d = %d
  381. // CHECK:STDOUT: }
  382. // CHECK:STDOUT:
  383. // CHECK:STDOUT: generic fn @F(%b.loc10_8.2: %tuple.type.9fb) {
  384. // CHECK:STDOUT: %b.loc10_8.1: %tuple.type.9fb = bind_symbolic_name b, 0 [symbolic = %b.loc10_8.1 (constants.%b)]
  385. // CHECK:STDOUT:
  386. // CHECK:STDOUT: !definition:
  387. // CHECK:STDOUT: %c.loc11_9.2: %tuple.type.bcd = bind_symbolic_name c, 1 [symbolic = %c.loc11_9.2 (constants.%c)]
  388. // CHECK:STDOUT: %tuple.elem0.loc14_21.3: %empty_tuple.type = tuple_access %b.loc10_8.1, element0 [symbolic = %tuple.elem0.loc14_21.3 (constants.%tuple.elem0.af8)]
  389. // CHECK:STDOUT: %tuple.elem0.loc15_24.3: %empty_tuple.type = tuple_access %c.loc11_9.2, element0 [symbolic = %tuple.elem0.loc15_24.3 (constants.%tuple.elem0.eaf)]
  390. // CHECK:STDOUT: %tuple.elem1.loc15_24.3: %empty_tuple.type = tuple_access %c.loc11_9.2, element1 [symbolic = %tuple.elem1.loc15_24.3 (constants.%tuple.elem1)]
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: fn() {
  393. // CHECK:STDOUT: !entry:
  394. // CHECK:STDOUT: name_binding_decl {
  395. // CHECK:STDOUT: %c.patt: %pattern_type.5b8 = symbolic_binding_pattern c, 1 [concrete]
  396. // CHECK:STDOUT: }
  397. // CHECK:STDOUT: %.loc11_26: %empty_tuple.type = tuple_literal ()
  398. // CHECK:STDOUT: %.loc11_30: %empty_tuple.type = tuple_literal ()
  399. // CHECK:STDOUT: %.loc11_31.1: %tuple.type.bcd = tuple_literal (%.loc11_26, %.loc11_30)
  400. // CHECK:STDOUT: %.loc11_20.1: type = splice_block %.loc11_20.5 [concrete = constants.%tuple.type.bcd] {
  401. // CHECK:STDOUT: %.loc11_15: %empty_tuple.type = tuple_literal ()
  402. // CHECK:STDOUT: %.loc11_19: %empty_tuple.type = tuple_literal ()
  403. // CHECK:STDOUT: %.loc11_20.2: %tuple.type.bcd = tuple_literal (%.loc11_15, %.loc11_19)
  404. // CHECK:STDOUT: %.loc11_20.3: type = converted %.loc11_15, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  405. // CHECK:STDOUT: %.loc11_20.4: type = converted %.loc11_19, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  406. // CHECK:STDOUT: %.loc11_20.5: type = converted %.loc11_20.2, constants.%tuple.type.bcd [concrete = constants.%tuple.type.bcd]
  407. // CHECK:STDOUT: }
  408. // CHECK:STDOUT: %empty_tuple.loc11_26: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  409. // CHECK:STDOUT: %.loc11_31.2: %empty_tuple.type = converted %.loc11_26, %empty_tuple.loc11_26 [concrete = constants.%empty_tuple]
  410. // CHECK:STDOUT: %empty_tuple.loc11_30: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
  411. // CHECK:STDOUT: %.loc11_31.3: %empty_tuple.type = converted %.loc11_30, %empty_tuple.loc11_30 [concrete = constants.%empty_tuple]
  412. // CHECK:STDOUT: %tuple: %tuple.type.bcd = tuple_value (%.loc11_31.2, %.loc11_31.3) [concrete = constants.%tuple.d8f]
  413. // CHECK:STDOUT: %.loc11_31.4: %tuple.type.bcd = converted %.loc11_31.1, %tuple [concrete = constants.%tuple.d8f]
  414. // CHECK:STDOUT: %c.loc11_9.1: %tuple.type.bcd = bind_symbolic_name c, 1, %.loc11_31.4 [symbolic = %c.loc11_9.2 (constants.%c)]
  415. // CHECK:STDOUT: name_binding_decl {
  416. // CHECK:STDOUT: %a1.patt: %pattern_type.cb1 = binding_pattern a1 [concrete]
  417. // CHECK:STDOUT: %a1.var_patt: %pattern_type.cb1 = var_pattern %a1.patt [concrete]
  418. // CHECK:STDOUT: }
  419. // CHECK:STDOUT: %a1.var: ref %empty_tuple.type = var %a1.var_patt
  420. // CHECK:STDOUT: %a.ref: %empty_tuple.type = name_ref a, @C.%a
  421. // CHECK:STDOUT: %.loc13_18: init %empty_tuple.type = tuple_init () to %a1.var [concrete = constants.%empty_tuple]
  422. // CHECK:STDOUT: %.loc13_5: init %empty_tuple.type = converted %a.ref, %.loc13_18 [concrete = constants.%empty_tuple]
  423. // CHECK:STDOUT: assign %a1.var, %.loc13_5
  424. // CHECK:STDOUT: %.loc13_14.1: type = splice_block %.loc13_14.3 [concrete = constants.%empty_tuple.type] {
  425. // CHECK:STDOUT: %.loc13_14.2: %empty_tuple.type = tuple_literal ()
  426. // CHECK:STDOUT: %.loc13_14.3: type = converted %.loc13_14.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  427. // CHECK:STDOUT: }
  428. // CHECK:STDOUT: %a1: ref %empty_tuple.type = bind_name a1, %a1.var
  429. // CHECK:STDOUT: name_binding_decl {
  430. // CHECK:STDOUT: %b1.patt: %pattern_type.559 = binding_pattern b1 [concrete]
  431. // CHECK:STDOUT: %b1.var_patt: %pattern_type.559 = var_pattern %b1.patt [concrete]
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT: %b1.var: ref %tuple.type.9fb = var %b1.var_patt
  434. // CHECK:STDOUT: %b.ref: %tuple.type.9fb = name_ref b, %b.loc10_8.2 [symbolic = %b.loc10_8.1 (constants.%b)]
  435. // CHECK:STDOUT: %tuple.elem0.loc14_21.1: %empty_tuple.type = tuple_access %b.ref, element0 [symbolic = %tuple.elem0.loc14_21.3 (constants.%tuple.elem0.af8)]
  436. // CHECK:STDOUT: %tuple.elem0.loc14_21.2: ref %empty_tuple.type = tuple_access %b1.var, element0
  437. // CHECK:STDOUT: %.loc14_21.1: init %empty_tuple.type = tuple_init () to %tuple.elem0.loc14_21.2 [concrete = constants.%empty_tuple]
  438. // CHECK:STDOUT: %.loc14_21.2: init %empty_tuple.type = converted %tuple.elem0.loc14_21.1, %.loc14_21.1 [concrete = constants.%empty_tuple]
  439. // CHECK:STDOUT: %.loc14_21.3: init %tuple.type.9fb = tuple_init (%.loc14_21.2) to %b1.var [concrete = constants.%tuple.f41]
  440. // CHECK:STDOUT: %.loc14_5: init %tuple.type.9fb = converted %b.ref, %.loc14_21.3 [concrete = constants.%tuple.f41]
  441. // CHECK:STDOUT: assign %b1.var, %.loc14_5
  442. // CHECK:STDOUT: %.loc14_17.1: type = splice_block %.loc14_17.4 [concrete = constants.%tuple.type.9fb] {
  443. // CHECK:STDOUT: %.loc14_15: %empty_tuple.type = tuple_literal ()
  444. // CHECK:STDOUT: %.loc14_17.2: %tuple.type.9fb = tuple_literal (%.loc14_15)
  445. // CHECK:STDOUT: %.loc14_17.3: type = converted %.loc14_15, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  446. // CHECK:STDOUT: %.loc14_17.4: type = converted %.loc14_17.2, constants.%tuple.type.9fb [concrete = constants.%tuple.type.9fb]
  447. // CHECK:STDOUT: }
  448. // CHECK:STDOUT: %b1: ref %tuple.type.9fb = bind_name b1, %b1.var
  449. // CHECK:STDOUT: name_binding_decl {
  450. // CHECK:STDOUT: %c1.patt: %pattern_type.5b8 = binding_pattern c1 [concrete]
  451. // CHECK:STDOUT: %c1.var_patt: %pattern_type.5b8 = var_pattern %c1.patt [concrete]
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT: %c1.var: ref %tuple.type.bcd = var %c1.var_patt
  454. // CHECK:STDOUT: %c.ref: %tuple.type.bcd = name_ref c, %c.loc11_9.1 [symbolic = %c.loc11_9.2 (constants.%c)]
  455. // CHECK:STDOUT: %tuple.elem0.loc15_24.1: %empty_tuple.type = tuple_access %c.ref, element0 [symbolic = %tuple.elem0.loc15_24.3 (constants.%tuple.elem0.eaf)]
  456. // CHECK:STDOUT: %tuple.elem0.loc15_24.2: ref %empty_tuple.type = tuple_access %c1.var, element0
  457. // CHECK:STDOUT: %.loc15_24.1: init %empty_tuple.type = tuple_init () to %tuple.elem0.loc15_24.2 [concrete = constants.%empty_tuple]
  458. // CHECK:STDOUT: %.loc15_24.2: init %empty_tuple.type = converted %tuple.elem0.loc15_24.1, %.loc15_24.1 [concrete = constants.%empty_tuple]
  459. // CHECK:STDOUT: %tuple.elem1.loc15_24.1: %empty_tuple.type = tuple_access %c.ref, element1 [symbolic = %tuple.elem1.loc15_24.3 (constants.%tuple.elem1)]
  460. // CHECK:STDOUT: %tuple.elem1.loc15_24.2: ref %empty_tuple.type = tuple_access %c1.var, element1
  461. // CHECK:STDOUT: %.loc15_24.3: init %empty_tuple.type = tuple_init () to %tuple.elem1.loc15_24.2 [concrete = constants.%empty_tuple]
  462. // CHECK:STDOUT: %.loc15_24.4: init %empty_tuple.type = converted %tuple.elem1.loc15_24.1, %.loc15_24.3 [concrete = constants.%empty_tuple]
  463. // CHECK:STDOUT: %.loc15_24.5: init %tuple.type.bcd = tuple_init (%.loc15_24.2, %.loc15_24.4) to %c1.var [concrete = constants.%tuple.d8f]
  464. // CHECK:STDOUT: %.loc15_5: init %tuple.type.bcd = converted %c.ref, %.loc15_24.5 [concrete = constants.%tuple.d8f]
  465. // CHECK:STDOUT: assign %c1.var, %.loc15_5
  466. // CHECK:STDOUT: %.loc15_20.1: type = splice_block %.loc15_20.5 [concrete = constants.%tuple.type.bcd] {
  467. // CHECK:STDOUT: %.loc15_15: %empty_tuple.type = tuple_literal ()
  468. // CHECK:STDOUT: %.loc15_19: %empty_tuple.type = tuple_literal ()
  469. // CHECK:STDOUT: %.loc15_20.2: %tuple.type.bcd = tuple_literal (%.loc15_15, %.loc15_19)
  470. // CHECK:STDOUT: %.loc15_20.3: type = converted %.loc15_15, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  471. // CHECK:STDOUT: %.loc15_20.4: type = converted %.loc15_19, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  472. // CHECK:STDOUT: %.loc15_20.5: type = converted %.loc15_20.2, constants.%tuple.type.bcd [concrete = constants.%tuple.type.bcd]
  473. // CHECK:STDOUT: }
  474. // CHECK:STDOUT: %c1: ref %tuple.type.bcd = bind_name c1, %c1.var
  475. // CHECK:STDOUT: name_binding_decl {
  476. // CHECK:STDOUT: %d1.patt: %pattern_type.8c1 = binding_pattern d1 [concrete]
  477. // CHECK:STDOUT: %d1.var_patt: %pattern_type.8c1 = var_pattern %d1.patt [concrete]
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT: %d1.var: ref %tuple.type.2d5 = var %d1.var_patt
  480. // CHECK:STDOUT: %d.ref: %tuple.type.2d5 = name_ref d, @C.%d
  481. // CHECK:STDOUT: %tuple.elem0.loc16_28.1: %empty_tuple.type = tuple_access %d.ref, element0
  482. // CHECK:STDOUT: %tuple.elem0.loc16_28.2: ref %empty_tuple.type = tuple_access %d1.var, element0
  483. // CHECK:STDOUT: %.loc16_28.1: init %empty_tuple.type = tuple_init () to %tuple.elem0.loc16_28.2 [concrete = constants.%empty_tuple]
  484. // CHECK:STDOUT: %.loc16_28.2: init %empty_tuple.type = converted %tuple.elem0.loc16_28.1, %.loc16_28.1 [concrete = constants.%empty_tuple]
  485. // CHECK:STDOUT: %tuple.elem1.loc16_28.1: %empty_tuple.type = tuple_access %d.ref, element1
  486. // CHECK:STDOUT: %tuple.elem1.loc16_28.2: ref %empty_tuple.type = tuple_access %d1.var, element1
  487. // CHECK:STDOUT: %.loc16_28.3: init %empty_tuple.type = tuple_init () to %tuple.elem1.loc16_28.2 [concrete = constants.%empty_tuple]
  488. // CHECK:STDOUT: %.loc16_28.4: init %empty_tuple.type = converted %tuple.elem1.loc16_28.1, %.loc16_28.3 [concrete = constants.%empty_tuple]
  489. // CHECK:STDOUT: %tuple.elem2.loc16_28.1: %empty_tuple.type = tuple_access %d.ref, element2
  490. // CHECK:STDOUT: %tuple.elem2.loc16_28.2: ref %empty_tuple.type = tuple_access %d1.var, element2
  491. // CHECK:STDOUT: %.loc16_28.5: init %empty_tuple.type = tuple_init () to %tuple.elem2.loc16_28.2 [concrete = constants.%empty_tuple]
  492. // CHECK:STDOUT: %.loc16_28.6: init %empty_tuple.type = converted %tuple.elem2.loc16_28.1, %.loc16_28.5 [concrete = constants.%empty_tuple]
  493. // CHECK:STDOUT: %.loc16_28.7: init %tuple.type.2d5 = tuple_init (%.loc16_28.2, %.loc16_28.4, %.loc16_28.6) to %d1.var [concrete = constants.%tuple.7e4]
  494. // CHECK:STDOUT: %.loc16_5: init %tuple.type.2d5 = converted %d.ref, %.loc16_28.7 [concrete = constants.%tuple.7e4]
  495. // CHECK:STDOUT: assign %d1.var, %.loc16_5
  496. // CHECK:STDOUT: %.loc16_24.1: type = splice_block %.loc16_24.6 [concrete = constants.%tuple.type.2d5] {
  497. // CHECK:STDOUT: %.loc16_15: %empty_tuple.type = tuple_literal ()
  498. // CHECK:STDOUT: %.loc16_19: %empty_tuple.type = tuple_literal ()
  499. // CHECK:STDOUT: %.loc16_23: %empty_tuple.type = tuple_literal ()
  500. // CHECK:STDOUT: %.loc16_24.2: %tuple.type.2d5 = tuple_literal (%.loc16_15, %.loc16_19, %.loc16_23)
  501. // CHECK:STDOUT: %.loc16_24.3: type = converted %.loc16_15, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  502. // CHECK:STDOUT: %.loc16_24.4: type = converted %.loc16_19, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  503. // CHECK:STDOUT: %.loc16_24.5: type = converted %.loc16_23, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  504. // CHECK:STDOUT: %.loc16_24.6: type = converted %.loc16_24.2, constants.%tuple.type.2d5 [concrete = constants.%tuple.type.2d5]
  505. // CHECK:STDOUT: }
  506. // CHECK:STDOUT: %d1: ref %tuple.type.2d5 = bind_name d1, %d1.var
  507. // CHECK:STDOUT: %Op.bound.loc16: <bound method> = bound_method %d1.var, constants.%Op.dce
  508. // CHECK:STDOUT: %Op.specific_fn.1: <specific function> = specific_function constants.%Op.dce, @Op.2(constants.%tuple.type.2d5) [concrete = constants.%Op.specific_fn.234]
  509. // CHECK:STDOUT: %bound_method.loc16: <bound method> = bound_method %d1.var, %Op.specific_fn.1
  510. // CHECK:STDOUT: %addr.loc16: %ptr.7fe = addr_of %d1.var
  511. // CHECK:STDOUT: %no_op.loc16: init %empty_tuple.type = call %bound_method.loc16(%addr.loc16)
  512. // CHECK:STDOUT: %Op.bound.loc15: <bound method> = bound_method %c1.var, constants.%Op.166
  513. // CHECK:STDOUT: %Op.specific_fn.2: <specific function> = specific_function constants.%Op.166, @Op.2(constants.%tuple.type.bcd) [concrete = constants.%Op.specific_fn.48a]
  514. // CHECK:STDOUT: %bound_method.loc15: <bound method> = bound_method %c1.var, %Op.specific_fn.2
  515. // CHECK:STDOUT: %addr.loc15: %ptr.709 = addr_of %c1.var
  516. // CHECK:STDOUT: %no_op.loc15: init %empty_tuple.type = call %bound_method.loc15(%addr.loc15)
  517. // CHECK:STDOUT: %Op.bound.loc14: <bound method> = bound_method %b1.var, constants.%Op.f19
  518. // CHECK:STDOUT: %Op.specific_fn.3: <specific function> = specific_function constants.%Op.f19, @Op.2(constants.%tuple.type.9fb) [concrete = constants.%Op.specific_fn.d2b]
  519. // CHECK:STDOUT: %bound_method.loc14: <bound method> = bound_method %b1.var, %Op.specific_fn.3
  520. // CHECK:STDOUT: %addr.loc14: %ptr.652 = addr_of %b1.var
  521. // CHECK:STDOUT: %no_op.loc14: init %empty_tuple.type = call %bound_method.loc14(%addr.loc14)
  522. // CHECK:STDOUT: %Op.bound.loc13: <bound method> = bound_method %a1.var, constants.%Op.ea3
  523. // CHECK:STDOUT: %Op.specific_fn.4: <specific function> = specific_function constants.%Op.ea3, @Op.2(constants.%empty_tuple.type) [concrete = constants.%Op.specific_fn.393]
  524. // CHECK:STDOUT: %bound_method.loc13: <bound method> = bound_method %a1.var, %Op.specific_fn.4
  525. // CHECK:STDOUT: %addr.loc13: %ptr.843 = addr_of %a1.var
  526. // CHECK:STDOUT: %no_op.loc13: init %empty_tuple.type = call %bound_method.loc13(%addr.loc13)
  527. // CHECK:STDOUT: return
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT: }
  530. // CHECK:STDOUT:
  531. // CHECK:STDOUT: specific @F(constants.%b) {
  532. // CHECK:STDOUT: %b.loc10_8.1 => constants.%b
  533. // CHECK:STDOUT: }
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: --- fail_invalid_let_after.carbon
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: constants {
  538. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  539. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  540. // CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
  541. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  542. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  543. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  544. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  545. // CHECK:STDOUT: }
  546. // CHECK:STDOUT:
  547. // CHECK:STDOUT: imports {
  548. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  549. // CHECK:STDOUT: import Core//prelude
  550. // CHECK:STDOUT: import Core//prelude/...
  551. // CHECK:STDOUT: }
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: file {
  555. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  556. // CHECK:STDOUT: .Core = imports.%Core
  557. // CHECK:STDOUT: .C = %C.decl
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT: %Core.import = import Core
  560. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  561. // CHECK:STDOUT: }
  562. // CHECK:STDOUT:
  563. // CHECK:STDOUT: class @C {
  564. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  565. // CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
  566. // CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
  567. // CHECK:STDOUT: } {
  568. // CHECK:STDOUT: %.loc5_14.1: %empty_tuple.type = tuple_literal ()
  569. // CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
  570. // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
  571. // CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
  572. // CHECK:STDOUT: }
  573. // CHECK:STDOUT: name_binding_decl {
  574. // CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  577. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  578. // CHECK:STDOUT: complete_type_witness = %complete_type
  579. // CHECK:STDOUT:
  580. // CHECK:STDOUT: !members:
  581. // CHECK:STDOUT: .Self = constants.%C
  582. // CHECK:STDOUT: .F = %F.decl
  583. // CHECK:STDOUT: .x = <unexpected>.inst32.loc14_7
  584. // CHECK:STDOUT: }
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: fn @F() -> %empty_tuple.type {
  587. // CHECK:STDOUT: !entry:
  588. // CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, <unexpected>.inst32.loc14_7
  589. // CHECK:STDOUT: return %x.ref
  590. // CHECK:STDOUT: }
  591. // CHECK:STDOUT:
  592. // CHECK:STDOUT: --- use_in_function.carbon
  593. // CHECK:STDOUT:
  594. // CHECK:STDOUT: constants {
  595. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  596. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  597. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  598. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  599. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  600. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  601. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  602. // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0 [symbolic]
  603. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  604. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  605. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  606. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  607. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  608. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  609. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To) [symbolic]
  610. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  611. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  612. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  613. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  614. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  615. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
  616. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
  617. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  618. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
  619. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  620. // CHECK:STDOUT: }
  621. // CHECK:STDOUT:
  622. // CHECK:STDOUT: imports {
  623. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  624. // CHECK:STDOUT: .Int = %Core.Int
  625. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  626. // CHECK:STDOUT: import Core//prelude
  627. // CHECK:STDOUT: import Core//prelude/...
  628. // CHECK:STDOUT: }
  629. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  630. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  631. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  632. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: file {
  636. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  637. // CHECK:STDOUT: .Core = imports.%Core
  638. // CHECK:STDOUT: .F = %F.decl
  639. // CHECK:STDOUT: }
  640. // CHECK:STDOUT: %Core.import = import Core
  641. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  642. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  643. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  644. // CHECK:STDOUT: } {
  645. // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  646. // CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  647. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  648. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  649. // CHECK:STDOUT: }
  650. // CHECK:STDOUT: }
  651. // CHECK:STDOUT:
  652. // CHECK:STDOUT: fn @F() -> %i32 {
  653. // CHECK:STDOUT: !entry:
  654. // CHECK:STDOUT: name_binding_decl {
  655. // CHECK:STDOUT: %Zero.patt: %pattern_type.7ce = symbolic_binding_pattern Zero, 0 [concrete]
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  658. // CHECK:STDOUT: %.loc5_14: type = splice_block %i32.loc5 [concrete = constants.%i32] {
  659. // CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  660. // CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  661. // CHECK:STDOUT: }
  662. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  663. // CHECK:STDOUT: %bound_method.loc5_20.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound]
  664. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  665. // CHECK:STDOUT: %bound_method.loc5_20.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
  666. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc5_20.2(%int_0) [concrete = constants.%int_0.6a9]
  667. // CHECK:STDOUT: %.loc5_20.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9]
  668. // CHECK:STDOUT: %.loc5_20.2: %i32 = converted %int_0, %.loc5_20.1 [concrete = constants.%int_0.6a9]
  669. // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0, %.loc5_20.2 [symbolic = constants.%Zero]
  670. // CHECK:STDOUT: %Zero.ref: %i32 = name_ref Zero, %Zero [symbolic = constants.%Zero]
  671. // CHECK:STDOUT: return %Zero.ref
  672. // CHECK:STDOUT: }
  673. // CHECK:STDOUT:
  674. // CHECK:STDOUT: --- use_in_block.carbon
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: constants {
  677. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  678. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  679. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  680. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  681. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  682. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  683. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  684. // CHECK:STDOUT: %true: bool = bool_literal true [concrete]
  685. // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0 [symbolic]
  686. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  687. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  688. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  689. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  690. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  691. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  692. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To) [symbolic]
  693. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  694. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  695. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  696. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  697. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  698. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
  699. // CHECK:STDOUT: %Convert.bound.d04: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
  700. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  701. // CHECK:STDOUT: %bound_method.b6e: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
  702. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  703. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  704. // CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [concrete]
  705. // CHECK:STDOUT: %bound_method.9a1: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
  706. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  707. // CHECK:STDOUT: }
  708. // CHECK:STDOUT:
  709. // CHECK:STDOUT: imports {
  710. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  711. // CHECK:STDOUT: .Int = %Core.Int
  712. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  713. // CHECK:STDOUT: import Core//prelude
  714. // CHECK:STDOUT: import Core//prelude/...
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  717. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  718. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  719. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  720. // CHECK:STDOUT: }
  721. // CHECK:STDOUT:
  722. // CHECK:STDOUT: file {
  723. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  724. // CHECK:STDOUT: .Core = imports.%Core
  725. // CHECK:STDOUT: .F = %F.decl
  726. // CHECK:STDOUT: }
  727. // CHECK:STDOUT: %Core.import = import Core
  728. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  729. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  730. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  731. // CHECK:STDOUT: } {
  732. // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  733. // CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  734. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  735. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  736. // CHECK:STDOUT: }
  737. // CHECK:STDOUT: }
  738. // CHECK:STDOUT:
  739. // CHECK:STDOUT: fn @F() -> %i32 {
  740. // CHECK:STDOUT: !entry:
  741. // CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
  742. // CHECK:STDOUT: if %true br !if.then else br !if.else
  743. // CHECK:STDOUT:
  744. // CHECK:STDOUT: !if.then:
  745. // CHECK:STDOUT: name_binding_decl {
  746. // CHECK:STDOUT: %Zero.patt: %pattern_type.7ce = symbolic_binding_pattern Zero, 0 [concrete]
  747. // CHECK:STDOUT: }
  748. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  749. // CHECK:STDOUT: %.loc6_16: type = splice_block %i32.loc6 [concrete = constants.%i32] {
  750. // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  751. // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  752. // CHECK:STDOUT: }
  753. // CHECK:STDOUT: %impl.elem0.loc6: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  754. // CHECK:STDOUT: %bound_method.loc6_22.1: <bound method> = bound_method %int_0, %impl.elem0.loc6 [concrete = constants.%Convert.bound.d04]
  755. // CHECK:STDOUT: %specific_fn.loc6: <specific function> = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  756. // CHECK:STDOUT: %bound_method.loc6_22.2: <bound method> = bound_method %int_0, %specific_fn.loc6 [concrete = constants.%bound_method.b6e]
  757. // CHECK:STDOUT: %int.convert_checked.loc6: init %i32 = call %bound_method.loc6_22.2(%int_0) [concrete = constants.%int_0.6a9]
  758. // CHECK:STDOUT: %.loc6_22.1: %i32 = value_of_initializer %int.convert_checked.loc6 [concrete = constants.%int_0.6a9]
  759. // CHECK:STDOUT: %.loc6_22.2: %i32 = converted %int_0, %.loc6_22.1 [concrete = constants.%int_0.6a9]
  760. // CHECK:STDOUT: %Zero: %i32 = bind_symbolic_name Zero, 0, %.loc6_22.2 [symbolic = constants.%Zero]
  761. // CHECK:STDOUT: %Zero.ref: %i32 = name_ref Zero, %Zero [symbolic = constants.%Zero]
  762. // CHECK:STDOUT: return %Zero.ref
  763. // CHECK:STDOUT:
  764. // CHECK:STDOUT: !if.else:
  765. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  766. // CHECK:STDOUT: %impl.elem0.loc9: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  767. // CHECK:STDOUT: %bound_method.loc9_11.1: <bound method> = bound_method %int_1, %impl.elem0.loc9 [concrete = constants.%Convert.bound.ab5]
  768. // CHECK:STDOUT: %specific_fn.loc9: <specific function> = specific_function %impl.elem0.loc9, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  769. // CHECK:STDOUT: %bound_method.loc9_11.2: <bound method> = bound_method %int_1, %specific_fn.loc9 [concrete = constants.%bound_method.9a1]
  770. // CHECK:STDOUT: %int.convert_checked.loc9: init %i32 = call %bound_method.loc9_11.2(%int_1) [concrete = constants.%int_1.5d2]
  771. // CHECK:STDOUT: %.loc9_11.1: %i32 = value_of_initializer %int.convert_checked.loc9 [concrete = constants.%int_1.5d2]
  772. // CHECK:STDOUT: %.loc9_11.2: %i32 = converted %int_1, %.loc9_11.1 [concrete = constants.%int_1.5d2]
  773. // CHECK:STDOUT: return %.loc9_11.2
  774. // CHECK:STDOUT: }
  775. // CHECK:STDOUT:
  776. // CHECK:STDOUT: --- return_in_interface.carbon
  777. // CHECK:STDOUT:
  778. // CHECK:STDOUT: constants {
  779. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  780. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  781. // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
  782. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
  783. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  784. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  785. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  786. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  787. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  788. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic]
  789. // CHECK:STDOUT: %I.facet: %I.type = facet_value %Self.as_type, (%I.lookup_impl_witness) [symbolic]
  790. // CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
  791. // CHECK:STDOUT: %pattern_type.ca5: type = pattern_type %impl.elem0 [symbolic]
  792. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  793. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  794. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%F.decl [concrete]
  795. // CHECK:STDOUT: }
  796. // CHECK:STDOUT:
  797. // CHECK:STDOUT: imports {
  798. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  799. // CHECK:STDOUT: .Int = %Core.Int
  800. // CHECK:STDOUT: import Core//prelude
  801. // CHECK:STDOUT: import Core//prelude/...
  802. // CHECK:STDOUT: }
  803. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  804. // CHECK:STDOUT: }
  805. // CHECK:STDOUT:
  806. // CHECK:STDOUT: file {
  807. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  808. // CHECK:STDOUT: .Core = imports.%Core
  809. // CHECK:STDOUT: .I = %I.decl
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT: %Core.import = import Core
  812. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  813. // CHECK:STDOUT: }
  814. // CHECK:STDOUT:
  815. // CHECK:STDOUT: interface @I {
  816. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  817. // CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
  818. // CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
  819. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  820. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  821. // CHECK:STDOUT: }
  822. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  823. // CHECK:STDOUT: %return.patt: @F.%pattern_type (%pattern_type.ca5) = return_slot_pattern [concrete]
  824. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type (%pattern_type.ca5) = out_param_pattern %return.patt, call_param0 [concrete]
  825. // CHECK:STDOUT: } {
  826. // CHECK:STDOUT: %impl.elem0.loc6_13.2: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_13.1 (constants.%impl.elem0)]
  827. // CHECK:STDOUT: %T.ref: type = name_ref T, %impl.elem0.loc6_13.2 [symbolic = %impl.elem0.loc6_13.1 (constants.%impl.elem0)]
  828. // CHECK:STDOUT: %return.param: ref @F.%impl.elem0.loc6_13.1 (%impl.elem0) = out_param call_param0
  829. // CHECK:STDOUT: %return: ref @F.%impl.elem0.loc6_13.1 (%impl.elem0) = return_slot %return.param
  830. // CHECK:STDOUT: }
  831. // CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %F.decl [concrete = constants.%assoc1]
  832. // CHECK:STDOUT:
  833. // CHECK:STDOUT: !members:
  834. // CHECK:STDOUT: .Self = %Self
  835. // CHECK:STDOUT: .T = @T.%assoc0
  836. // CHECK:STDOUT: .F = %assoc1
  837. // CHECK:STDOUT: witness = (%T, %F.decl)
  838. // CHECK:STDOUT: }
  839. // CHECK:STDOUT:
  840. // CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
  841. // CHECK:STDOUT: !definition:
  842. // CHECK:STDOUT:
  843. // CHECK:STDOUT: assoc_const T:! type = %i32;
  844. // CHECK:STDOUT: }
  845. // CHECK:STDOUT:
  846. // CHECK:STDOUT: generic fn @F(@I.%Self: %I.type) {
  847. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  848. // CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
  849. // CHECK:STDOUT: %impl.elem0.loc6_13.1: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_13.1 (constants.%impl.elem0)]
  850. // CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc6_13.1 [symbolic = %pattern_type (constants.%pattern_type.ca5)]
  851. // CHECK:STDOUT:
  852. // CHECK:STDOUT: fn() -> @F.%impl.elem0.loc6_13.1 (%impl.elem0);
  853. // CHECK:STDOUT: }
  854. // CHECK:STDOUT:
  855. // CHECK:STDOUT: specific @T(constants.%Self) {}
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: specific @T(constants.%I.facet) {}
  858. // CHECK:STDOUT:
  859. // CHECK:STDOUT: specific @F(constants.%Self) {
  860. // CHECK:STDOUT: %Self => constants.%Self
  861. // CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness
  862. // CHECK:STDOUT: %impl.elem0.loc6_13.1 => constants.%impl.elem0
  863. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ca5
  864. // CHECK:STDOUT: }
  865. // CHECK:STDOUT:
  866. // CHECK:STDOUT: --- fail_return_in_class.carbon
  867. // CHECK:STDOUT:
  868. // CHECK:STDOUT: constants {
  869. // CHECK:STDOUT: %I: type = class_type @I [concrete]
  870. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  871. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  872. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  873. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  874. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  875. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  876. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  877. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  878. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  879. // CHECK:STDOUT: }
  880. // CHECK:STDOUT:
  881. // CHECK:STDOUT: imports {
  882. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  883. // CHECK:STDOUT: .Int = %Core.Int
  884. // CHECK:STDOUT: import Core//prelude
  885. // CHECK:STDOUT: import Core//prelude/...
  886. // CHECK:STDOUT: }
  887. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  888. // CHECK:STDOUT: }
  889. // CHECK:STDOUT:
  890. // CHECK:STDOUT: file {
  891. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  892. // CHECK:STDOUT: .Core = imports.%Core
  893. // CHECK:STDOUT: .I = %I.decl
  894. // CHECK:STDOUT: }
  895. // CHECK:STDOUT: %Core.import = import Core
  896. // CHECK:STDOUT: %I.decl: type = class_decl @I [concrete = constants.%I] {} {}
  897. // CHECK:STDOUT: }
  898. // CHECK:STDOUT:
  899. // CHECK:STDOUT: class @I {
  900. // CHECK:STDOUT: name_binding_decl {
  901. // CHECK:STDOUT: %T.patt: %pattern_type.98f = binding_pattern T [concrete]
  902. // CHECK:STDOUT: }
  903. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  904. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  905. // CHECK:STDOUT: %T: type = bind_name T, %i32
  906. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  907. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern [concrete]
  908. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param0 [concrete]
  909. // CHECK:STDOUT: } {
  910. // CHECK:STDOUT: %T.ref: type = name_ref T, @I.%T
  911. // CHECK:STDOUT: %return.param: ref <error> = out_param call_param0
  912. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  913. // CHECK:STDOUT: }
  914. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
  915. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357]
  916. // CHECK:STDOUT: complete_type_witness = %complete_type
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: !members:
  919. // CHECK:STDOUT: .Self = constants.%I
  920. // CHECK:STDOUT: .T = %T
  921. // CHECK:STDOUT: .F = %F.decl
  922. // CHECK:STDOUT: }
  923. // CHECK:STDOUT:
  924. // CHECK:STDOUT: fn @F() -> <error>;
  925. // CHECK:STDOUT:
  926. // CHECK:STDOUT: --- fail_return_in_package_scope.carbon
  927. // CHECK:STDOUT:
  928. // CHECK:STDOUT: constants {
  929. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  930. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  931. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  932. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  933. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  934. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  935. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  936. // CHECK:STDOUT: }
  937. // CHECK:STDOUT:
  938. // CHECK:STDOUT: imports {
  939. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  940. // CHECK:STDOUT: .Int = %Core.Int
  941. // CHECK:STDOUT: import Core//prelude
  942. // CHECK:STDOUT: import Core//prelude/...
  943. // CHECK:STDOUT: }
  944. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  945. // CHECK:STDOUT: }
  946. // CHECK:STDOUT:
  947. // CHECK:STDOUT: file {
  948. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  949. // CHECK:STDOUT: .Core = imports.%Core
  950. // CHECK:STDOUT: .T = %T
  951. // CHECK:STDOUT: .F = %F.decl
  952. // CHECK:STDOUT: }
  953. // CHECK:STDOUT: %Core.import = import Core
  954. // CHECK:STDOUT: name_binding_decl {
  955. // CHECK:STDOUT: %T.patt: %pattern_type.98f = binding_pattern T [concrete]
  956. // CHECK:STDOUT: }
  957. // CHECK:STDOUT: %T: type = bind_name T, @__global_init.%i32
  958. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  959. // CHECK:STDOUT: %return.patt: <error> = return_slot_pattern [concrete]
  960. // CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param0 [concrete]
  961. // CHECK:STDOUT: } {
  962. // CHECK:STDOUT: %T.ref: type = name_ref T, file.%T
  963. // CHECK:STDOUT: %return.param: ref <error> = out_param call_param0
  964. // CHECK:STDOUT: %return: ref <error> = return_slot %return.param
  965. // CHECK:STDOUT: }
  966. // CHECK:STDOUT: }
  967. // CHECK:STDOUT:
  968. // CHECK:STDOUT: fn @F() -> <error>;
  969. // CHECK:STDOUT:
  970. // CHECK:STDOUT: fn @__global_init() {
  971. // CHECK:STDOUT: !entry:
  972. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  973. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  974. // CHECK:STDOUT: return
  975. // CHECK:STDOUT: }
  976. // CHECK:STDOUT:
  977. // CHECK:STDOUT: --- fail_use_in_impl.carbon
  978. // CHECK:STDOUT:
  979. // CHECK:STDOUT: constants {
  980. // CHECK:STDOUT: %Empty.type: type = facet_type <@Empty> [concrete]
  981. // CHECK:STDOUT: %Self.193: %Empty.type = bind_symbolic_name Self, 0 [symbolic]
  982. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  983. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  984. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  985. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  986. // CHECK:STDOUT: %Empty.impl_witness: <witness> = impl_witness file.%Empty.impl_witness_table [concrete]
  987. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  988. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  989. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  990. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  991. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  992. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
  993. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  994. // CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To) [symbolic]
  995. // CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic]
  996. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete]
  997. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete]
  998. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
  999. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  1000. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
  1001. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
  1002. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.956, @Convert.2(%int_32) [concrete]
  1003. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0.5c6, %Convert.specific_fn [concrete]
  1004. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  1005. // CHECK:STDOUT: }
  1006. // CHECK:STDOUT:
  1007. // CHECK:STDOUT: imports {
  1008. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1009. // CHECK:STDOUT: .Int = %Core.Int
  1010. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1011. // CHECK:STDOUT: import Core//prelude
  1012. // CHECK:STDOUT: import Core//prelude/...
  1013. // CHECK:STDOUT: }
  1014. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1015. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1016. // CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)]
  1017. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete]
  1018. // CHECK:STDOUT: }
  1019. // CHECK:STDOUT:
  1020. // CHECK:STDOUT: file {
  1021. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1022. // CHECK:STDOUT: .Core = imports.%Core
  1023. // CHECK:STDOUT: .Empty = %Empty.decl
  1024. // CHECK:STDOUT: }
  1025. // CHECK:STDOUT: %Core.import = import Core
  1026. // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [concrete = constants.%Empty.type] {} {}
  1027. // CHECK:STDOUT: impl_decl @impl.cfd [concrete] {} {
  1028. // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1029. // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1030. // CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type]
  1031. // CHECK:STDOUT: }
  1032. // CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @impl.cfd [concrete]
  1033. // CHECK:STDOUT: %Empty.impl_witness: <witness> = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness]
  1034. // CHECK:STDOUT: }
  1035. // CHECK:STDOUT:
  1036. // CHECK:STDOUT: interface @Empty {
  1037. // CHECK:STDOUT: %Self: %Empty.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.193]
  1038. // CHECK:STDOUT:
  1039. // CHECK:STDOUT: !members:
  1040. // CHECK:STDOUT: .Self = %Self
  1041. // CHECK:STDOUT: witness = ()
  1042. // CHECK:STDOUT: }
  1043. // CHECK:STDOUT:
  1044. // CHECK:STDOUT: impl @impl.cfd: %i32.loc6 as %Empty.ref {
  1045. // CHECK:STDOUT: name_binding_decl {
  1046. // CHECK:STDOUT: %Zero.patt: %pattern_type.7ce = binding_pattern Zero [concrete]
  1047. // CHECK:STDOUT: }
  1048. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  1049. // CHECK:STDOUT: %.loc11_14: type = splice_block %i32.loc11 [concrete = constants.%i32] {
  1050. // CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1051. // CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1052. // CHECK:STDOUT: }
  1053. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
  1054. // CHECK:STDOUT: %bound_method.loc11_20.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound]
  1055. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
  1056. // CHECK:STDOUT: %bound_method.loc11_20.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
  1057. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_20.2(%int_0) [concrete = constants.%int_0.6a9]
  1058. // CHECK:STDOUT: %.loc11_20.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9]
  1059. // CHECK:STDOUT: %.loc11_20.2: %i32 = converted %int_0, %.loc11_20.1 [concrete = constants.%int_0.6a9]
  1060. // CHECK:STDOUT: %Zero: %i32 = bind_name Zero, %.loc11_20.2
  1061. // CHECK:STDOUT:
  1062. // CHECK:STDOUT: !members:
  1063. // CHECK:STDOUT: .Zero = %Zero
  1064. // CHECK:STDOUT: witness = file.%Empty.impl_witness
  1065. // CHECK:STDOUT: }
  1066. // CHECK:STDOUT: