array.carbon 105 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373
  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. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/deduce/array.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/deduce/array.carbon
  14. // --- type_only.carbon
  15. library "[[@TEST_NAME]]";
  16. class C {}
  17. fn F[T:! type](a: array(T, 3)) -> T { return F(a); }
  18. fn G() -> C {
  19. var a: array(C, 3) = ({}, {}, {});
  20. return F(a);
  21. }
  22. // --- bound_only.carbon
  23. library "[[@TEST_NAME]]";
  24. class C {}
  25. fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; }
  26. fn G() -> i32 {
  27. var a: array(C, 3) = ({}, {}, {});
  28. return F(a);
  29. }
  30. // --- type_and_bound.carbon
  31. library "[[@TEST_NAME]]";
  32. class C {}
  33. fn F[T:! type, N:! Core.IntLiteral()](a: array(T, N)) {}
  34. fn G() {
  35. var a: array(C, 3) = ({}, {}, {});
  36. F(a);
  37. }
  38. // --- fail_bound_mismatch.carbon
  39. library "[[@TEST_NAME]]";
  40. class C {}
  41. fn F[T:! type](a: array(T, 2)) -> T { return F(a); }
  42. fn G() -> C {
  43. // TODO: We succeed at deducing T here but fail to convert. Is this the right behavior?
  44. var a: array(C, 3) = ({}, {}, {});
  45. // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+10]]:12: error: cannot implicitly convert expression of type `array(C, 3)` to `array(C, 2)` [ConversionFailure]
  46. // CHECK:STDERR: return F(a);
  47. // CHECK:STDERR: ^
  48. // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE+7]]:12: note: type `array(C, 3)` does not implement interface `Core.ImplicitAs(array(C, 2))` [MissingImplInMemberAccessNote]
  49. // CHECK:STDERR: return F(a);
  50. // CHECK:STDERR: ^
  51. // CHECK:STDERR: fail_bound_mismatch.carbon:[[@LINE-11]]:16: note: initializing function parameter [InCallToFunctionParam]
  52. // CHECK:STDERR: fn F[T:! type](a: array(T, 2)) -> T { return F(a); }
  53. // CHECK:STDERR: ^~~~~~~~~~~~~~
  54. // CHECK:STDERR:
  55. return F(a);
  56. }
  57. // --- fail_type_mismatch.carbon
  58. library "[[@TEST_NAME]]";
  59. class C {}
  60. class D {}
  61. fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; }
  62. fn G() -> i32 {
  63. // TODO: We succeed at deducing N here but fail to convert. Is this the right behavior?
  64. var a: array(D, 3) = ({}, {}, {});
  65. // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+10]]:12: error: cannot implicitly convert expression of type `array(D, 3)` to `array(C, 3)` [ConversionFailure]
  66. // CHECK:STDERR: return F(a);
  67. // CHECK:STDERR: ^
  68. // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:12: note: type `array(D, 3)` does not implement interface `Core.ImplicitAs(array(C, 3))` [MissingImplInMemberAccessNote]
  69. // CHECK:STDERR: return F(a);
  70. // CHECK:STDERR: ^
  71. // CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-11]]:29: note: initializing function parameter [InCallToFunctionParam]
  72. // CHECK:STDERR: fn F[N:! Core.IntLiteral()](a: array(C, N)) -> i32 { return N; }
  73. // CHECK:STDERR: ^~~~~~~~~~~~~~
  74. // CHECK:STDERR:
  75. return F(a);
  76. }
  77. // --- fail_bound_type_mismatch.carbon
  78. library "[[@TEST_NAME]]";
  79. class C {}
  80. fn F[N:! i32](a: array(C, N)) -> i32 { return N; }
  81. fn G() -> i32 {
  82. var a: array(C, 3) = ({}, {}, {});
  83. // TODO: This fails because the array bound in `F` is effectively
  84. // `N.(ImplicitAs(IntLiteral).Convert)()`
  85. // which we can't deduce through. We should decide if we want to support
  86. // deductions of that form. If not, it'd be nice to diagnose this situation
  87. // better.
  88. // CHECK:STDERR: fail_bound_type_mismatch.carbon:[[@LINE+7]]:10: error: cannot deduce value for generic parameter `N` [DeductionIncomplete]
  89. // CHECK:STDERR: return F(a);
  90. // CHECK:STDERR: ^~~~
  91. // CHECK:STDERR: fail_bound_type_mismatch.carbon:[[@LINE-12]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  92. // CHECK:STDERR: fn F[N:! i32](a: array(C, N)) -> i32 { return N; }
  93. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94. // CHECK:STDERR:
  95. return F(a);
  96. }
  97. // CHECK:STDOUT: --- type_only.carbon
  98. // CHECK:STDOUT:
  99. // CHECK:STDOUT: constants {
  100. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  101. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  102. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  103. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  104. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  105. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  106. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  107. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  108. // CHECK:STDOUT: %array_type.743: type = array_type %int_3, %T [symbolic]
  109. // CHECK:STDOUT: %pattern_type.58b: type = pattern_type %array_type.743 [symbolic]
  110. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  111. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  112. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  113. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  114. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  115. // CHECK:STDOUT: %require_complete.06f: <witness> = require_complete_type %array_type.743 [symbolic]
  116. // CHECK:STDOUT: %F.specific_fn.ef1: <specific function> = specific_function %F, @F(%T) [symbolic]
  117. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  118. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  119. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  120. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  121. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  122. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  123. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  124. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  125. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  126. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  127. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  128. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  129. // CHECK:STDOUT: %F.specific_fn.04a: <specific function> = specific_function %F, @F(%C) [concrete]
  130. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  131. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  132. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  133. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  134. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f70: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2 = struct_value () [concrete]
  135. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  136. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT:
  139. // CHECK:STDOUT: imports {
  140. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  141. // CHECK:STDOUT: .Destroy = %Core.Destroy
  142. // CHECK:STDOUT: import Core//prelude
  143. // CHECK:STDOUT: import Core//prelude/...
  144. // CHECK:STDOUT: }
  145. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: file {
  149. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  150. // CHECK:STDOUT: .Core = imports.%Core
  151. // CHECK:STDOUT: .C = %C.decl
  152. // CHECK:STDOUT: .F = %F.decl
  153. // CHECK:STDOUT: .G = %G.decl
  154. // CHECK:STDOUT: }
  155. // CHECK:STDOUT: %Core.import = import Core
  156. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  157. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  158. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  159. // CHECK:STDOUT: %a.patt: @F.%pattern_type.loc6_16 (%pattern_type.58b) = binding_pattern a [concrete]
  160. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc6_16 (%pattern_type.58b) = value_param_pattern %a.patt, call_param0 [concrete]
  161. // CHECK:STDOUT: %return.patt: @F.%pattern_type.loc6_32 (%pattern_type.7dc) = return_slot_pattern [concrete]
  162. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type.loc6_32 (%pattern_type.7dc) = out_param_pattern %return.patt, call_param1 [concrete]
  163. // CHECK:STDOUT: } {
  164. // CHECK:STDOUT: %T.ref.loc6_35: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  165. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  166. // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  167. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_29.1 (%array_type.743) = value_param call_param0
  168. // CHECK:STDOUT: %.loc6_29: type = splice_block %array_type.loc6_29.2 [symbolic = %array_type.loc6_29.1 (constants.%array_type.743)] {
  169. // CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  170. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  171. // CHECK:STDOUT: %array_type.loc6_29.2: type = array_type %int_3, %T.ref.loc6_25 [symbolic = %array_type.loc6_29.1 (constants.%array_type.743)]
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT: %a: @F.%array_type.loc6_29.1 (%array_type.743) = bind_name a, %a.param
  174. // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.1 (%T) = out_param call_param1
  175. // CHECK:STDOUT: %return: ref @F.%T.loc6_6.1 (%T) = return_slot %return.param
  176. // CHECK:STDOUT: }
  177. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  178. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  179. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param0 [concrete]
  180. // CHECK:STDOUT: } {
  181. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  182. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  183. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  184. // CHECK:STDOUT: }
  185. // CHECK:STDOUT: }
  186. // CHECK:STDOUT:
  187. // CHECK:STDOUT: class @C {
  188. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  189. // CHECK:STDOUT: complete_type_witness = %complete_type
  190. // CHECK:STDOUT:
  191. // CHECK:STDOUT: !members:
  192. // CHECK:STDOUT: .Self = constants.%C
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type) {
  196. // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  197. // CHECK:STDOUT: %array_type.loc6_29.1: type = array_type constants.%int_3, %T.loc6_6.1 [symbolic = %array_type.loc6_29.1 (constants.%array_type.743)]
  198. // CHECK:STDOUT: %pattern_type.loc6_16: type = pattern_type %array_type.loc6_29.1 [symbolic = %pattern_type.loc6_16 (constants.%pattern_type.58b)]
  199. // CHECK:STDOUT: %pattern_type.loc6_32: type = pattern_type %T.loc6_6.1 [symbolic = %pattern_type.loc6_32 (constants.%pattern_type.7dc)]
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: !definition:
  202. // CHECK:STDOUT: %require_complete.loc6_32: <witness> = require_complete_type %T.loc6_6.1 [symbolic = %require_complete.loc6_32 (constants.%require_complete.4ae)]
  203. // CHECK:STDOUT: %require_complete.loc6_17: <witness> = require_complete_type %array_type.loc6_29.1 [symbolic = %require_complete.loc6_17 (constants.%require_complete.06f)]
  204. // CHECK:STDOUT: %F.specific_fn.loc6_46.2: <specific function> = specific_function constants.%F, @F(%T.loc6_6.1) [symbolic = %F.specific_fn.loc6_46.2 (constants.%F.specific_fn.ef1)]
  205. // CHECK:STDOUT:
  206. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_29.1 (%array_type.743)) -> %return.param: @F.%T.loc6_6.1 (%T) {
  207. // CHECK:STDOUT: !entry:
  208. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  209. // CHECK:STDOUT: %a.ref: @F.%array_type.loc6_29.1 (%array_type.743) = name_ref a, %a
  210. // CHECK:STDOUT: %F.specific_fn.loc6_46.1: <specific function> = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc6_46.2 (constants.%F.specific_fn.ef1)]
  211. // CHECK:STDOUT: %.loc6_32: ref @F.%T.loc6_6.1 (%T) = splice_block %return {}
  212. // CHECK:STDOUT: %F.call: init @F.%T.loc6_6.1 (%T) = call %F.specific_fn.loc6_46.1(%a.ref) to %.loc6_32
  213. // CHECK:STDOUT: return %F.call to %return
  214. // CHECK:STDOUT: }
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT:
  217. // CHECK:STDOUT: fn @G() -> %return.param: %C {
  218. // CHECK:STDOUT: !entry:
  219. // CHECK:STDOUT: name_binding_decl {
  220. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  221. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  224. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal ()
  225. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal ()
  226. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal ()
  227. // CHECK:STDOUT: %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
  228. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  229. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  230. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  231. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  232. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  233. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  234. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  235. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  236. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  237. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  238. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  239. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  240. // CHECK:STDOUT: %.loc9_35.8: init %array_type.002 = array_init (%.loc9_35.3, %.loc9_35.5, %.loc9_35.7) to %a.var [concrete = constants.%array]
  241. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  242. // CHECK:STDOUT: assign %a.var, %.loc9_3
  243. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  244. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [concrete = constants.%C]
  245. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  246. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref.loc9 [concrete = constants.%array_type.002]
  247. // CHECK:STDOUT: }
  248. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  249. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  250. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  251. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn.04a]
  252. // CHECK:STDOUT: %.loc8: ref %C = splice_block %return {}
  253. // CHECK:STDOUT: %.loc10: %array_type.002 = bind_value %a.ref
  254. // CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%.loc10) to %.loc8
  255. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70
  256. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  257. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  258. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  259. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  260. // CHECK:STDOUT: return %F.call to %return
  261. // CHECK:STDOUT: }
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: specific @F(constants.%T) {
  264. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  265. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.743
  266. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.58b
  267. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.7dc
  268. // CHECK:STDOUT:
  269. // CHECK:STDOUT: !definition:
  270. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%require_complete.4ae
  271. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%require_complete.06f
  272. // CHECK:STDOUT: %F.specific_fn.loc6_46.2 => constants.%F.specific_fn.ef1
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: specific @F(constants.%C) {
  276. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  277. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.002
  278. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.a63
  279. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.c48
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: !definition:
  282. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%complete_type.357
  283. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.dd1
  284. // CHECK:STDOUT: %F.specific_fn.loc6_46.2 => constants.%F.specific_fn.04a
  285. // CHECK:STDOUT: }
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: --- bound_only.carbon
  288. // CHECK:STDOUT:
  289. // CHECK:STDOUT: constants {
  290. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  291. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  292. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  293. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  294. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  295. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  296. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  297. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  298. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  299. // CHECK:STDOUT: %array_type.6a2: type = array_type %N, %C [symbolic]
  300. // CHECK:STDOUT: %pattern_type.9ee: type = pattern_type %array_type.6a2 [symbolic]
  301. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  302. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  303. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  304. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  305. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  306. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  307. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  308. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  309. // CHECK:STDOUT: %require_complete.d82: <witness> = require_complete_type %array_type.6a2 [symbolic]
  310. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  311. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  312. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  313. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  314. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  315. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  316. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  317. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  318. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  319. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  320. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  321. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  322. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.818: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [symbolic]
  323. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  324. // CHECK:STDOUT: %bound_method.775: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  325. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.775(%N) [symbolic]
  326. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  327. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  328. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  329. // CHECK:STDOUT: %array_type.002: type = array_type %int_3.1ba, %C [concrete]
  330. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  331. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  332. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  333. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  334. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  335. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  336. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  337. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  338. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_3.1ba) [concrete]
  339. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  340. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  341. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  342. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  343. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f70: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2 = struct_value () [concrete]
  344. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  345. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  346. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.595: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  347. // CHECK:STDOUT: %bound_method.f36: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  348. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: imports {
  352. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  353. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  354. // CHECK:STDOUT: .Int = %Core.Int
  355. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  356. // CHECK:STDOUT: .Destroy = %Core.Destroy
  357. // CHECK:STDOUT: import Core//prelude
  358. // CHECK:STDOUT: import Core//prelude/...
  359. // CHECK:STDOUT: }
  360. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  361. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  362. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  363. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)]
  364. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  365. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  366. // CHECK:STDOUT: }
  367. // CHECK:STDOUT:
  368. // CHECK:STDOUT: file {
  369. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  370. // CHECK:STDOUT: .Core = imports.%Core
  371. // CHECK:STDOUT: .C = %C.decl
  372. // CHECK:STDOUT: .F = %F.decl
  373. // CHECK:STDOUT: .G = %G.decl
  374. // CHECK:STDOUT: }
  375. // CHECK:STDOUT: %Core.import = import Core
  376. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  377. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  378. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete]
  379. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.9ee) = binding_pattern a [concrete]
  380. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.9ee) = value_param_pattern %a.patt, call_param0 [concrete]
  381. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  382. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  383. // CHECK:STDOUT: } {
  384. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  385. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  386. // CHECK:STDOUT: %.loc6_26.1: type = splice_block %.loc6_26.3 [concrete = Core.IntLiteral] {
  387. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  388. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  389. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  390. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  391. // CHECK:STDOUT: %.loc6_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  392. // CHECK:STDOUT: %.loc6_26.3: type = converted %IntLiteral.call, %.loc6_26.2 [concrete = Core.IntLiteral]
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: %N.loc6_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.1 (constants.%N)]
  395. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_42.1 (%array_type.6a2) = value_param call_param0
  396. // CHECK:STDOUT: %.loc6_42: type = splice_block %array_type.loc6_42.2 [symbolic = %array_type.loc6_42.1 (constants.%array_type.6a2)] {
  397. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  398. // CHECK:STDOUT: %N.ref.loc6_41: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)]
  399. // CHECK:STDOUT: %array_type.loc6_42.2: type = array_type %N.ref.loc6_41, %C.ref [symbolic = %array_type.loc6_42.1 (constants.%array_type.6a2)]
  400. // CHECK:STDOUT: }
  401. // CHECK:STDOUT: %a: @F.%array_type.loc6_42.1 (%array_type.6a2) = bind_name a, %a.param
  402. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  403. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  406. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  407. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  408. // CHECK:STDOUT: } {
  409. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  410. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  411. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  412. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: class @C {
  417. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  418. // CHECK:STDOUT: complete_type_witness = %complete_type
  419. // CHECK:STDOUT:
  420. // CHECK:STDOUT: !members:
  421. // CHECK:STDOUT: .Self = constants.%C
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT:
  424. // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: Core.IntLiteral) {
  425. // CHECK:STDOUT: %N.loc6_6.1: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.1 (constants.%N)]
  426. // CHECK:STDOUT: %array_type.loc6_42.1: type = array_type %N.loc6_6.1, constants.%C [symbolic = %array_type.loc6_42.1 (constants.%array_type.6a2)]
  427. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_42.1 [symbolic = %pattern_type (constants.%pattern_type.9ee)]
  428. // CHECK:STDOUT:
  429. // CHECK:STDOUT: !definition:
  430. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_42.1 [symbolic = %require_complete (constants.%require_complete.d82)]
  431. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc6_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.818)]
  432. // CHECK:STDOUT: %bound_method.loc6_62.3: <bound method> = bound_method %N.loc6_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_62.3 (constants.%bound_method.775)]
  433. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2: init %i32 = call %bound_method.loc6_62.3(%N.loc6_6.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  434. // CHECK:STDOUT:
  435. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_42.1 (%array_type.6a2)) -> %i32 {
  436. // CHECK:STDOUT: !entry:
  437. // CHECK:STDOUT: %N.ref.loc6_61: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)]
  438. // CHECK:STDOUT: %impl.elem0: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  439. // CHECK:STDOUT: %bound_method.loc6_62.1: <bound method> = bound_method %N.ref.loc6_61, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.818)]
  440. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  441. // CHECK:STDOUT: %bound_method.loc6_62.2: <bound method> = bound_method %N.ref.loc6_61, %specific_fn [symbolic = %bound_method.loc6_62.3 (constants.%bound_method.775)]
  442. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.1: init %i32 = call %bound_method.loc6_62.2(%N.ref.loc6_61) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  443. // CHECK:STDOUT: %.loc6_62: init %i32 = converted %N.ref.loc6_61, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  444. // CHECK:STDOUT: return %.loc6_62 to %return
  445. // CHECK:STDOUT: }
  446. // CHECK:STDOUT: }
  447. // CHECK:STDOUT:
  448. // CHECK:STDOUT: fn @G() -> %i32 {
  449. // CHECK:STDOUT: !entry:
  450. // CHECK:STDOUT: name_binding_decl {
  451. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  452. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  455. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal ()
  456. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal ()
  457. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal ()
  458. // CHECK:STDOUT: %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
  459. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  460. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  461. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  462. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  463. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  464. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  465. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  466. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  467. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  468. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  469. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  470. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  471. // CHECK:STDOUT: %.loc9_35.8: init %array_type.002 = array_init (%.loc9_35.3, %.loc9_35.5, %.loc9_35.7) to %a.var [concrete = constants.%array]
  472. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  473. // CHECK:STDOUT: assign %a.var, %.loc9_3
  474. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  475. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  476. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  477. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  480. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  481. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  482. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn]
  483. // CHECK:STDOUT: %.loc10: %array_type.002 = bind_value %a.ref
  484. // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc10)
  485. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70
  486. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  487. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  488. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  489. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  490. // CHECK:STDOUT: return %F.call to %return
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: specific @F(constants.%N) {
  494. // CHECK:STDOUT: %N.loc6_6.1 => constants.%N
  495. // CHECK:STDOUT: %array_type.loc6_42.1 => constants.%array_type.6a2
  496. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9ee
  497. // CHECK:STDOUT: }
  498. // CHECK:STDOUT:
  499. // CHECK:STDOUT: specific @F(constants.%int_3.1ba) {
  500. // CHECK:STDOUT: %N.loc6_6.1 => constants.%int_3.1ba
  501. // CHECK:STDOUT: %array_type.loc6_42.1 => constants.%array_type.002
  502. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: !definition:
  505. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  506. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.595
  507. // CHECK:STDOUT: %bound_method.loc6_62.3 => constants.%bound_method.f36
  508. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 => constants.%int_3.822
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: --- type_and_bound.carbon
  512. // CHECK:STDOUT:
  513. // CHECK:STDOUT: constants {
  514. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  515. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  516. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  517. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  518. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  519. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  520. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  521. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  522. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  523. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 1 [symbolic]
  524. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  525. // CHECK:STDOUT: %array_type.bb5: type = array_type %N, %T [symbolic]
  526. // CHECK:STDOUT: %pattern_type.261: type = pattern_type %array_type.bb5 [symbolic]
  527. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  528. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  529. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  530. // CHECK:STDOUT: %require_complete.ec9: <witness> = require_complete_type %array_type.bb5 [symbolic]
  531. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  532. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  533. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  534. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  535. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  536. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  537. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  538. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  539. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  540. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  541. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  542. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  543. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%C, %int_3) [concrete]
  544. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  545. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  546. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  547. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  548. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f70: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2 = struct_value () [concrete]
  549. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  550. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  551. // CHECK:STDOUT: }
  552. // CHECK:STDOUT:
  553. // CHECK:STDOUT: imports {
  554. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  555. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  556. // CHECK:STDOUT: .Destroy = %Core.Destroy
  557. // CHECK:STDOUT: import Core//prelude
  558. // CHECK:STDOUT: import Core//prelude/...
  559. // CHECK:STDOUT: }
  560. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  561. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  562. // CHECK:STDOUT: }
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: file {
  565. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  566. // CHECK:STDOUT: .Core = imports.%Core
  567. // CHECK:STDOUT: .C = %C.decl
  568. // CHECK:STDOUT: .F = %F.decl
  569. // CHECK:STDOUT: .G = %G.decl
  570. // CHECK:STDOUT: }
  571. // CHECK:STDOUT: %Core.import = import Core
  572. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  573. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  574. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  575. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 1 [concrete]
  576. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.261) = binding_pattern a [concrete]
  577. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.261) = value_param_pattern %a.patt, call_param0 [concrete]
  578. // CHECK:STDOUT: } {
  579. // CHECK:STDOUT: %.Self.1: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  580. // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  581. // CHECK:STDOUT: %.loc6_36.1: type = splice_block %.loc6_36.3 [concrete = Core.IntLiteral] {
  582. // CHECK:STDOUT: %.Self.2: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  583. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  584. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  585. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  586. // CHECK:STDOUT: %.loc6_36.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  587. // CHECK:STDOUT: %.loc6_36.3: type = converted %IntLiteral.call, %.loc6_36.2 [concrete = Core.IntLiteral]
  588. // CHECK:STDOUT: }
  589. // CHECK:STDOUT: %N.loc6_16.2: Core.IntLiteral = bind_symbolic_name N, 1 [symbolic = %N.loc6_16.1 (constants.%N)]
  590. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_52.1 (%array_type.bb5) = value_param call_param0
  591. // CHECK:STDOUT: %.loc6_52: type = splice_block %array_type.loc6_52.2 [symbolic = %array_type.loc6_52.1 (constants.%array_type.bb5)] {
  592. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  593. // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc6_16.2 [symbolic = %N.loc6_16.1 (constants.%N)]
  594. // CHECK:STDOUT: %array_type.loc6_52.2: type = array_type %N.ref, %T.ref [symbolic = %array_type.loc6_52.1 (constants.%array_type.bb5)]
  595. // CHECK:STDOUT: }
  596. // CHECK:STDOUT: %a: @F.%array_type.loc6_52.1 (%array_type.bb5) = bind_name a, %a.param
  597. // CHECK:STDOUT: }
  598. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  599. // CHECK:STDOUT: }
  600. // CHECK:STDOUT:
  601. // CHECK:STDOUT: class @C {
  602. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  603. // CHECK:STDOUT: complete_type_witness = %complete_type
  604. // CHECK:STDOUT:
  605. // CHECK:STDOUT: !members:
  606. // CHECK:STDOUT: .Self = constants.%C
  607. // CHECK:STDOUT: }
  608. // CHECK:STDOUT:
  609. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type, %N.loc6_16.2: Core.IntLiteral) {
  610. // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  611. // CHECK:STDOUT: %N.loc6_16.1: Core.IntLiteral = bind_symbolic_name N, 1 [symbolic = %N.loc6_16.1 (constants.%N)]
  612. // CHECK:STDOUT: %array_type.loc6_52.1: type = array_type %N.loc6_16.1, %T.loc6_6.1 [symbolic = %array_type.loc6_52.1 (constants.%array_type.bb5)]
  613. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_52.1 [symbolic = %pattern_type (constants.%pattern_type.261)]
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: !definition:
  616. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_52.1 [symbolic = %require_complete (constants.%require_complete.ec9)]
  617. // CHECK:STDOUT:
  618. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_52.1 (%array_type.bb5)) {
  619. // CHECK:STDOUT: !entry:
  620. // CHECK:STDOUT: return
  621. // CHECK:STDOUT: }
  622. // CHECK:STDOUT: }
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: fn @G() {
  625. // CHECK:STDOUT: !entry:
  626. // CHECK:STDOUT: name_binding_decl {
  627. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  628. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  629. // CHECK:STDOUT: }
  630. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  631. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal ()
  632. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal ()
  633. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal ()
  634. // CHECK:STDOUT: %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
  635. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  636. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  637. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  638. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  639. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  640. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  641. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  642. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  643. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  644. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  645. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  646. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  647. // CHECK:STDOUT: %.loc9_35.8: init %array_type.002 = array_init (%.loc9_35.3, %.loc9_35.5, %.loc9_35.7) to %a.var [concrete = constants.%array]
  648. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  649. // CHECK:STDOUT: assign %a.var, %.loc9_3
  650. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  651. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  652. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  653. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  656. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  657. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  658. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C, constants.%int_3) [concrete = constants.%F.specific_fn]
  659. // CHECK:STDOUT: %.loc10: %array_type.002 = bind_value %a.ref
  660. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc10)
  661. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70
  662. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  663. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  664. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  665. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  666. // CHECK:STDOUT: return
  667. // CHECK:STDOUT: }
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: specific @F(constants.%T, constants.%N) {
  670. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  671. // CHECK:STDOUT: %N.loc6_16.1 => constants.%N
  672. // CHECK:STDOUT: %array_type.loc6_52.1 => constants.%array_type.bb5
  673. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.261
  674. // CHECK:STDOUT: }
  675. // CHECK:STDOUT:
  676. // CHECK:STDOUT: specific @F(constants.%C, constants.%int_3) {
  677. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  678. // CHECK:STDOUT: %N.loc6_16.1 => constants.%int_3
  679. // CHECK:STDOUT: %array_type.loc6_52.1 => constants.%array_type.002
  680. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  681. // CHECK:STDOUT:
  682. // CHECK:STDOUT: !definition:
  683. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  684. // CHECK:STDOUT: }
  685. // CHECK:STDOUT:
  686. // CHECK:STDOUT: --- fail_bound_mismatch.carbon
  687. // CHECK:STDOUT:
  688. // CHECK:STDOUT: constants {
  689. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  690. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  691. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  692. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  693. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  694. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  695. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  696. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  697. // CHECK:STDOUT: %array_type.9d4: type = array_type %int_2, %T [symbolic]
  698. // CHECK:STDOUT: %pattern_type.a4c: type = pattern_type %array_type.9d4 [symbolic]
  699. // CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic]
  700. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  701. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  702. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  703. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  704. // CHECK:STDOUT: %require_complete.d11: <witness> = require_complete_type %array_type.9d4 [symbolic]
  705. // CHECK:STDOUT: %F.specific_fn.ef1: <specific function> = specific_function %F, @F(%T) [symbolic]
  706. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  707. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  708. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  709. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  710. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  711. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  712. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  713. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  714. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  715. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  716. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  717. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  718. // CHECK:STDOUT: %array_type.15a: type = array_type %int_2, %C [concrete]
  719. // CHECK:STDOUT: %pattern_type.114: type = pattern_type %array_type.15a [concrete]
  720. // CHECK:STDOUT: %F.specific_fn.04a: <specific function> = specific_function %F, @F(%C) [concrete]
  721. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  722. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  723. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  724. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  725. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  726. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  727. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f70: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2 = struct_value () [concrete]
  728. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  729. // CHECK:STDOUT: %complete_type.8eb: <witness> = complete_type_witness %array_type.15a [concrete]
  730. // CHECK:STDOUT: }
  731. // CHECK:STDOUT:
  732. // CHECK:STDOUT: imports {
  733. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  734. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  735. // CHECK:STDOUT: .Destroy = %Core.Destroy
  736. // CHECK:STDOUT: import Core//prelude
  737. // CHECK:STDOUT: import Core//prelude/...
  738. // CHECK:STDOUT: }
  739. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  740. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  741. // CHECK:STDOUT: }
  742. // CHECK:STDOUT:
  743. // CHECK:STDOUT: file {
  744. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  745. // CHECK:STDOUT: .Core = imports.%Core
  746. // CHECK:STDOUT: .C = %C.decl
  747. // CHECK:STDOUT: .F = %F.decl
  748. // CHECK:STDOUT: .G = %G.decl
  749. // CHECK:STDOUT: }
  750. // CHECK:STDOUT: %Core.import = import Core
  751. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  752. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  753. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  754. // CHECK:STDOUT: %a.patt: @F.%pattern_type.loc6_16 (%pattern_type.a4c) = binding_pattern a [concrete]
  755. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc6_16 (%pattern_type.a4c) = value_param_pattern %a.patt, call_param0 [concrete]
  756. // CHECK:STDOUT: %return.patt: @F.%pattern_type.loc6_32 (%pattern_type.7dcd0a.1) = return_slot_pattern [concrete]
  757. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type.loc6_32 (%pattern_type.7dcd0a.1) = out_param_pattern %return.patt, call_param1 [concrete]
  758. // CHECK:STDOUT: } {
  759. // CHECK:STDOUT: %T.ref.loc6_35: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  760. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  761. // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  762. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_29.1 (%array_type.9d4) = value_param call_param0
  763. // CHECK:STDOUT: %.loc6_29: type = splice_block %array_type.loc6_29.2 [symbolic = %array_type.loc6_29.1 (constants.%array_type.9d4)] {
  764. // CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  765. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  766. // CHECK:STDOUT: %array_type.loc6_29.2: type = array_type %int_2, %T.ref.loc6_25 [symbolic = %array_type.loc6_29.1 (constants.%array_type.9d4)]
  767. // CHECK:STDOUT: }
  768. // CHECK:STDOUT: %a: @F.%array_type.loc6_29.1 (%array_type.9d4) = bind_name a, %a.param
  769. // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.1 (%T) = out_param call_param1
  770. // CHECK:STDOUT: %return: ref @F.%T.loc6_6.1 (%T) = return_slot %return.param
  771. // CHECK:STDOUT: }
  772. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  773. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  774. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param0 [concrete]
  775. // CHECK:STDOUT: } {
  776. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  777. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  778. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  779. // CHECK:STDOUT: }
  780. // CHECK:STDOUT: }
  781. // CHECK:STDOUT:
  782. // CHECK:STDOUT: class @C {
  783. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  784. // CHECK:STDOUT: complete_type_witness = %complete_type
  785. // CHECK:STDOUT:
  786. // CHECK:STDOUT: !members:
  787. // CHECK:STDOUT: .Self = constants.%C
  788. // CHECK:STDOUT: }
  789. // CHECK:STDOUT:
  790. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type) {
  791. // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  792. // CHECK:STDOUT: %array_type.loc6_29.1: type = array_type constants.%int_2, %T.loc6_6.1 [symbolic = %array_type.loc6_29.1 (constants.%array_type.9d4)]
  793. // CHECK:STDOUT: %pattern_type.loc6_16: type = pattern_type %array_type.loc6_29.1 [symbolic = %pattern_type.loc6_16 (constants.%pattern_type.a4c)]
  794. // CHECK:STDOUT: %pattern_type.loc6_32: type = pattern_type %T.loc6_6.1 [symbolic = %pattern_type.loc6_32 (constants.%pattern_type.7dcd0a.1)]
  795. // CHECK:STDOUT:
  796. // CHECK:STDOUT: !definition:
  797. // CHECK:STDOUT: %require_complete.loc6_32: <witness> = require_complete_type %T.loc6_6.1 [symbolic = %require_complete.loc6_32 (constants.%require_complete.4ae)]
  798. // CHECK:STDOUT: %require_complete.loc6_17: <witness> = require_complete_type %array_type.loc6_29.1 [symbolic = %require_complete.loc6_17 (constants.%require_complete.d11)]
  799. // CHECK:STDOUT: %F.specific_fn.loc6_46.2: <specific function> = specific_function constants.%F, @F(%T.loc6_6.1) [symbolic = %F.specific_fn.loc6_46.2 (constants.%F.specific_fn.ef1)]
  800. // CHECK:STDOUT:
  801. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_29.1 (%array_type.9d4)) -> %return.param: @F.%T.loc6_6.1 (%T) {
  802. // CHECK:STDOUT: !entry:
  803. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  804. // CHECK:STDOUT: %a.ref: @F.%array_type.loc6_29.1 (%array_type.9d4) = name_ref a, %a
  805. // CHECK:STDOUT: %F.specific_fn.loc6_46.1: <specific function> = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc6_46.2 (constants.%F.specific_fn.ef1)]
  806. // CHECK:STDOUT: %.loc6_32: ref @F.%T.loc6_6.1 (%T) = splice_block %return {}
  807. // CHECK:STDOUT: %F.call: init @F.%T.loc6_6.1 (%T) = call %F.specific_fn.loc6_46.1(%a.ref) to %.loc6_32
  808. // CHECK:STDOUT: return %F.call to %return
  809. // CHECK:STDOUT: }
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT:
  812. // CHECK:STDOUT: fn @G() -> %return.param: %C {
  813. // CHECK:STDOUT: !entry:
  814. // CHECK:STDOUT: name_binding_decl {
  815. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  816. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  817. // CHECK:STDOUT: }
  818. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  819. // CHECK:STDOUT: %.loc10_26.1: %empty_struct_type = struct_literal ()
  820. // CHECK:STDOUT: %.loc10_30.1: %empty_struct_type = struct_literal ()
  821. // CHECK:STDOUT: %.loc10_34.1: %empty_struct_type = struct_literal ()
  822. // CHECK:STDOUT: %.loc10_35.1: %tuple.type.8d4 = tuple_literal (%.loc10_26.1, %.loc10_30.1, %.loc10_34.1)
  823. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  824. // CHECK:STDOUT: %.loc10_35.2: ref %C = array_index %a.var, %int_0
  825. // CHECK:STDOUT: %.loc10_26.2: init %C = class_init (), %.loc10_35.2 [concrete = constants.%C.val]
  826. // CHECK:STDOUT: %.loc10_35.3: init %C = converted %.loc10_26.1, %.loc10_26.2 [concrete = constants.%C.val]
  827. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  828. // CHECK:STDOUT: %.loc10_35.4: ref %C = array_index %a.var, %int_1
  829. // CHECK:STDOUT: %.loc10_30.2: init %C = class_init (), %.loc10_35.4 [concrete = constants.%C.val]
  830. // CHECK:STDOUT: %.loc10_35.5: init %C = converted %.loc10_30.1, %.loc10_30.2 [concrete = constants.%C.val]
  831. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  832. // CHECK:STDOUT: %.loc10_35.6: ref %C = array_index %a.var, %int_2
  833. // CHECK:STDOUT: %.loc10_34.2: init %C = class_init (), %.loc10_35.6 [concrete = constants.%C.val]
  834. // CHECK:STDOUT: %.loc10_35.7: init %C = converted %.loc10_34.1, %.loc10_34.2 [concrete = constants.%C.val]
  835. // CHECK:STDOUT: %.loc10_35.8: init %array_type.002 = array_init (%.loc10_35.3, %.loc10_35.5, %.loc10_35.7) to %a.var [concrete = constants.%array]
  836. // CHECK:STDOUT: %.loc10_3: init %array_type.002 = converted %.loc10_35.1, %.loc10_35.8 [concrete = constants.%array]
  837. // CHECK:STDOUT: assign %a.var, %.loc10_3
  838. // CHECK:STDOUT: %.loc10_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  839. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [concrete = constants.%C]
  840. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  841. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref.loc10 [concrete = constants.%array_type.002]
  842. // CHECK:STDOUT: }
  843. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  844. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  845. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  846. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn.04a]
  847. // CHECK:STDOUT: %.loc8: ref %C = splice_block %return {}
  848. // CHECK:STDOUT: %.loc21: %array_type.15a = converted %a.ref, <error> [concrete = <error>]
  849. // CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(<error>) to %.loc8
  850. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70
  851. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  852. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  853. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  854. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  855. // CHECK:STDOUT: return %F.call to %return
  856. // CHECK:STDOUT: }
  857. // CHECK:STDOUT:
  858. // CHECK:STDOUT: specific @F(constants.%T) {
  859. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  860. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.9d4
  861. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.a4c
  862. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.7dcd0a.1
  863. // CHECK:STDOUT:
  864. // CHECK:STDOUT: !definition:
  865. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%require_complete.4ae
  866. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%require_complete.d11
  867. // CHECK:STDOUT: %F.specific_fn.loc6_46.2 => constants.%F.specific_fn.ef1
  868. // CHECK:STDOUT: }
  869. // CHECK:STDOUT:
  870. // CHECK:STDOUT: specific @F(constants.%C) {
  871. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  872. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.15a
  873. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.114
  874. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.c48
  875. // CHECK:STDOUT:
  876. // CHECK:STDOUT: !definition:
  877. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%complete_type.357
  878. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.8eb
  879. // CHECK:STDOUT: %F.specific_fn.loc6_46.2 => constants.%F.specific_fn.04a
  880. // CHECK:STDOUT: }
  881. // CHECK:STDOUT:
  882. // CHECK:STDOUT: --- fail_type_mismatch.carbon
  883. // CHECK:STDOUT:
  884. // CHECK:STDOUT: constants {
  885. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  886. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  887. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  888. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  889. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  890. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  891. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  892. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  893. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  894. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  895. // CHECK:STDOUT: %array_type.6a2: type = array_type %N, %C [symbolic]
  896. // CHECK:STDOUT: %pattern_type.9ee: type = pattern_type %array_type.6a2 [symbolic]
  897. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  898. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  899. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  900. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  901. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  902. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  903. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  904. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  905. // CHECK:STDOUT: %require_complete.d82: <witness> = require_complete_type %array_type.6a2 [symbolic]
  906. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  907. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  908. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  909. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  910. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  911. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  912. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340 = struct_value () [symbolic]
  913. // CHECK:STDOUT: %ImplicitAs.impl_witness.204: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.9e9, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  914. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  915. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.584 = struct_value () [concrete]
  916. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.204) [concrete]
  917. // CHECK:STDOUT: %.1df: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  918. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.818: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [symbolic]
  919. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  920. // CHECK:STDOUT: %bound_method.775: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  921. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.775(%N) [symbolic]
  922. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  923. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  924. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  925. // CHECK:STDOUT: %array_type.fe4: type = array_type %int_3.1ba, %D [concrete]
  926. // CHECK:STDOUT: %ptr.af6: type = ptr_type %array_type.fe4 [concrete]
  927. // CHECK:STDOUT: %pattern_type.f30: type = pattern_type %array_type.fe4 [concrete]
  928. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  929. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  930. // CHECK:STDOUT: %D.val: %D = struct_value () [concrete]
  931. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  932. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  933. // CHECK:STDOUT: %array: %array_type.fe4 = tuple_value (%D.val, %D.val, %D.val) [concrete]
  934. // CHECK:STDOUT: %array_type.002: type = array_type %int_3.1ba, %C [concrete]
  935. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  936. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_3.1ba) [concrete]
  937. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  938. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  939. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.fe4, () [concrete]
  940. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.64a: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  941. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.1d7: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.64a = struct_value () [concrete]
  942. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.1d7, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  943. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  944. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.595: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [concrete]
  945. // CHECK:STDOUT: %bound_method.f36: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  946. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  947. // CHECK:STDOUT: }
  948. // CHECK:STDOUT:
  949. // CHECK:STDOUT: imports {
  950. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  951. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  952. // CHECK:STDOUT: .Int = %Core.Int
  953. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  954. // CHECK:STDOUT: .Destroy = %Core.Destroy
  955. // CHECK:STDOUT: import Core//prelude
  956. // CHECK:STDOUT: import Core//prelude/...
  957. // CHECK:STDOUT: }
  958. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  959. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  960. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  961. // CHECK:STDOUT: %Core.import_ref.ee7: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.340) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.1c0)]
  962. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.9e9 = impl_witness_table (%Core.import_ref.ee7), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  963. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  964. // CHECK:STDOUT: }
  965. // CHECK:STDOUT:
  966. // CHECK:STDOUT: file {
  967. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  968. // CHECK:STDOUT: .Core = imports.%Core
  969. // CHECK:STDOUT: .C = %C.decl
  970. // CHECK:STDOUT: .D = %D.decl
  971. // CHECK:STDOUT: .F = %F.decl
  972. // CHECK:STDOUT: .G = %G.decl
  973. // CHECK:STDOUT: }
  974. // CHECK:STDOUT: %Core.import = import Core
  975. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  976. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  977. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  978. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete]
  979. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.9ee) = binding_pattern a [concrete]
  980. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.9ee) = value_param_pattern %a.patt, call_param0 [concrete]
  981. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  982. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  983. // CHECK:STDOUT: } {
  984. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  985. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  986. // CHECK:STDOUT: %.loc7_26.1: type = splice_block %.loc7_26.3 [concrete = Core.IntLiteral] {
  987. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  988. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  989. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  990. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  991. // CHECK:STDOUT: %.loc7_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  992. // CHECK:STDOUT: %.loc7_26.3: type = converted %IntLiteral.call, %.loc7_26.2 [concrete = Core.IntLiteral]
  993. // CHECK:STDOUT: }
  994. // CHECK:STDOUT: %N.loc7_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc7_6.1 (constants.%N)]
  995. // CHECK:STDOUT: %a.param: @F.%array_type.loc7_42.1 (%array_type.6a2) = value_param call_param0
  996. // CHECK:STDOUT: %.loc7_42: type = splice_block %array_type.loc7_42.2 [symbolic = %array_type.loc7_42.1 (constants.%array_type.6a2)] {
  997. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  998. // CHECK:STDOUT: %N.ref.loc7_41: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)]
  999. // CHECK:STDOUT: %array_type.loc7_42.2: type = array_type %N.ref.loc7_41, %C.ref [symbolic = %array_type.loc7_42.1 (constants.%array_type.6a2)]
  1000. // CHECK:STDOUT: }
  1001. // CHECK:STDOUT: %a: @F.%array_type.loc7_42.1 (%array_type.6a2) = bind_name a, %a.param
  1002. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1003. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1004. // CHECK:STDOUT: }
  1005. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1006. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1007. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  1008. // CHECK:STDOUT: } {
  1009. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1010. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1011. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  1012. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1013. // CHECK:STDOUT: }
  1014. // CHECK:STDOUT: }
  1015. // CHECK:STDOUT:
  1016. // CHECK:STDOUT: class @C {
  1017. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1018. // CHECK:STDOUT: complete_type_witness = %complete_type
  1019. // CHECK:STDOUT:
  1020. // CHECK:STDOUT: !members:
  1021. // CHECK:STDOUT: .Self = constants.%C
  1022. // CHECK:STDOUT: }
  1023. // CHECK:STDOUT:
  1024. // CHECK:STDOUT: class @D {
  1025. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1026. // CHECK:STDOUT: complete_type_witness = %complete_type
  1027. // CHECK:STDOUT:
  1028. // CHECK:STDOUT: !members:
  1029. // CHECK:STDOUT: .Self = constants.%D
  1030. // CHECK:STDOUT: }
  1031. // CHECK:STDOUT:
  1032. // CHECK:STDOUT: generic fn @F(%N.loc7_6.2: Core.IntLiteral) {
  1033. // CHECK:STDOUT: %N.loc7_6.1: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc7_6.1 (constants.%N)]
  1034. // CHECK:STDOUT: %array_type.loc7_42.1: type = array_type %N.loc7_6.1, constants.%C [symbolic = %array_type.loc7_42.1 (constants.%array_type.6a2)]
  1035. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_42.1 [symbolic = %pattern_type (constants.%pattern_type.9ee)]
  1036. // CHECK:STDOUT:
  1037. // CHECK:STDOUT: !definition:
  1038. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc7_42.1 [symbolic = %require_complete (constants.%require_complete.d82)]
  1039. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc7_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.818)]
  1040. // CHECK:STDOUT: %bound_method.loc7_62.3: <bound method> = bound_method %N.loc7_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc7_62.3 (constants.%bound_method.775)]
  1041. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2: init %i32 = call %bound_method.loc7_62.3(%N.loc7_6.1) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  1042. // CHECK:STDOUT:
  1043. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc7_42.1 (%array_type.6a2)) -> %i32 {
  1044. // CHECK:STDOUT: !entry:
  1045. // CHECK:STDOUT: %N.ref.loc7_61: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)]
  1046. // CHECK:STDOUT: %impl.elem0: %.1df = impl_witness_access constants.%ImplicitAs.impl_witness.204, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0f0]
  1047. // CHECK:STDOUT: %bound_method.loc7_62.1: <bound method> = bound_method %N.ref.loc7_61, %impl.elem0 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.818)]
  1048. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1049. // CHECK:STDOUT: %bound_method.loc7_62.2: <bound method> = bound_method %N.ref.loc7_61, %specific_fn [symbolic = %bound_method.loc7_62.3 (constants.%bound_method.775)]
  1050. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.1: init %i32 = call %bound_method.loc7_62.2(%N.ref.loc7_61) [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  1051. // CHECK:STDOUT: %.loc7_62: init %i32 = converted %N.ref.loc7_61, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  1052. // CHECK:STDOUT: return %.loc7_62 to %return
  1053. // CHECK:STDOUT: }
  1054. // CHECK:STDOUT: }
  1055. // CHECK:STDOUT:
  1056. // CHECK:STDOUT: fn @G() -> %i32 {
  1057. // CHECK:STDOUT: !entry:
  1058. // CHECK:STDOUT: name_binding_decl {
  1059. // CHECK:STDOUT: %a.patt: %pattern_type.f30 = binding_pattern a [concrete]
  1060. // CHECK:STDOUT: %a.var_patt: %pattern_type.f30 = var_pattern %a.patt [concrete]
  1061. // CHECK:STDOUT: }
  1062. // CHECK:STDOUT: %a.var: ref %array_type.fe4 = var %a.var_patt
  1063. // CHECK:STDOUT: %.loc11_26.1: %empty_struct_type = struct_literal ()
  1064. // CHECK:STDOUT: %.loc11_30.1: %empty_struct_type = struct_literal ()
  1065. // CHECK:STDOUT: %.loc11_34.1: %empty_struct_type = struct_literal ()
  1066. // CHECK:STDOUT: %.loc11_35.1: %tuple.type.8d4 = tuple_literal (%.loc11_26.1, %.loc11_30.1, %.loc11_34.1)
  1067. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  1068. // CHECK:STDOUT: %.loc11_35.2: ref %D = array_index %a.var, %int_0
  1069. // CHECK:STDOUT: %.loc11_26.2: init %D = class_init (), %.loc11_35.2 [concrete = constants.%D.val]
  1070. // CHECK:STDOUT: %.loc11_35.3: init %D = converted %.loc11_26.1, %.loc11_26.2 [concrete = constants.%D.val]
  1071. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1072. // CHECK:STDOUT: %.loc11_35.4: ref %D = array_index %a.var, %int_1
  1073. // CHECK:STDOUT: %.loc11_30.2: init %D = class_init (), %.loc11_35.4 [concrete = constants.%D.val]
  1074. // CHECK:STDOUT: %.loc11_35.5: init %D = converted %.loc11_30.1, %.loc11_30.2 [concrete = constants.%D.val]
  1075. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  1076. // CHECK:STDOUT: %.loc11_35.6: ref %D = array_index %a.var, %int_2
  1077. // CHECK:STDOUT: %.loc11_34.2: init %D = class_init (), %.loc11_35.6 [concrete = constants.%D.val]
  1078. // CHECK:STDOUT: %.loc11_35.7: init %D = converted %.loc11_34.1, %.loc11_34.2 [concrete = constants.%D.val]
  1079. // CHECK:STDOUT: %.loc11_35.8: init %array_type.fe4 = array_init (%.loc11_35.3, %.loc11_35.5, %.loc11_35.7) to %a.var [concrete = constants.%array]
  1080. // CHECK:STDOUT: %.loc11_3: init %array_type.fe4 = converted %.loc11_35.1, %.loc11_35.8 [concrete = constants.%array]
  1081. // CHECK:STDOUT: assign %a.var, %.loc11_3
  1082. // CHECK:STDOUT: %.loc11_20: type = splice_block %array_type [concrete = constants.%array_type.fe4] {
  1083. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1084. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  1085. // CHECK:STDOUT: %array_type: type = array_type %int_3, %D.ref [concrete = constants.%array_type.fe4]
  1086. // CHECK:STDOUT: }
  1087. // CHECK:STDOUT: %a: ref %array_type.fe4 = bind_name a, %a.var
  1088. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  1089. // CHECK:STDOUT: %a.ref: ref %array_type.fe4 = name_ref a, %a
  1090. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn]
  1091. // CHECK:STDOUT: %.loc22: %array_type.002 = converted %a.ref, <error> [concrete = <error>]
  1092. // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(<error>)
  1093. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.1d7
  1094. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.1d7, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  1095. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  1096. // CHECK:STDOUT: %addr: %ptr.af6 = addr_of %a.var
  1097. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  1098. // CHECK:STDOUT: return %F.call to %return
  1099. // CHECK:STDOUT: }
  1100. // CHECK:STDOUT:
  1101. // CHECK:STDOUT: specific @F(constants.%N) {
  1102. // CHECK:STDOUT: %N.loc7_6.1 => constants.%N
  1103. // CHECK:STDOUT: %array_type.loc7_42.1 => constants.%array_type.6a2
  1104. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9ee
  1105. // CHECK:STDOUT: }
  1106. // CHECK:STDOUT:
  1107. // CHECK:STDOUT: specific @F(constants.%int_3.1ba) {
  1108. // CHECK:STDOUT: %N.loc7_6.1 => constants.%int_3.1ba
  1109. // CHECK:STDOUT: %array_type.loc7_42.1 => constants.%array_type.002
  1110. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  1111. // CHECK:STDOUT:
  1112. // CHECK:STDOUT: !definition:
  1113. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  1114. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.595
  1115. // CHECK:STDOUT: %bound_method.loc7_62.3 => constants.%bound_method.f36
  1116. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 => constants.%int_3.822
  1117. // CHECK:STDOUT: }
  1118. // CHECK:STDOUT:
  1119. // CHECK:STDOUT: --- fail_bound_type_mismatch.carbon
  1120. // CHECK:STDOUT:
  1121. // CHECK:STDOUT: constants {
  1122. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1123. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1124. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1125. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1126. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  1127. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1128. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1129. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1130. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1131. // CHECK:STDOUT: %N.c80: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  1132. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1133. // CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic]
  1134. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  1135. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1136. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1137. // CHECK:STDOUT: %ImplicitAs.type.7a9: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  1138. // CHECK:STDOUT: %ImplicitAs.Convert.type.71e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
  1139. // CHECK:STDOUT: %From: Core.IntLiteral = bind_symbolic_name From, 0 [symbolic]
  1140. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.543: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic]
  1141. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.c08: %Int.as.ImplicitAs.impl.Convert.type.543 = struct_value () [symbolic]
  1142. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bf: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.e99, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  1143. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.516: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  1144. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.b09: %Int.as.ImplicitAs.impl.Convert.type.516 = struct_value () [concrete]
  1145. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.7a9 = facet_value %i32, (%ImplicitAs.impl_witness.6bf) [concrete]
  1146. // CHECK:STDOUT: %.81e: type = fn_type_with_self_type %ImplicitAs.Convert.type.71e, %ImplicitAs.facet [concrete]
  1147. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.51e, %Int.as.ImplicitAs.impl.Convert.b09 [symbolic]
  1148. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Int.as.ImplicitAs.impl.Convert.b09, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  1149. // CHECK:STDOUT: %bound_method.b86: <bound method> = bound_method %N.51e, %Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  1150. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.b86(%N.51e) [symbolic]
  1151. // CHECK:STDOUT: %array_type.566: type = array_type %Int.as.ImplicitAs.impl.Convert.call, %C [symbolic]
  1152. // CHECK:STDOUT: %pattern_type.9a8: type = pattern_type %array_type.566 [symbolic]
  1153. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1154. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1155. // CHECK:STDOUT: %require_complete.0fa: <witness> = require_complete_type %array_type.566 [symbolic]
  1156. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  1157. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  1158. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.afd: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N.c80) [symbolic]
  1159. // CHECK:STDOUT: %Int.as.Copy.impl.Op.6cd: %Int.as.Copy.impl.Op.type.afd = struct_value () [symbolic]
  1160. // CHECK:STDOUT: %Copy.impl_witness.a32: <witness> = impl_witness imports.%Copy.impl_witness_table.1ed, @Int.as.Copy.impl(%int_32) [concrete]
  1161. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.276: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
  1162. // CHECK:STDOUT: %Int.as.Copy.impl.Op.f59: %Int.as.Copy.impl.Op.type.276 = struct_value () [concrete]
  1163. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.a32) [concrete]
  1164. // CHECK:STDOUT: %.7fa: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
  1165. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %N.51e, %Int.as.Copy.impl.Op.f59 [symbolic]
  1166. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.f59, @Int.as.Copy.impl.Op(%int_32) [concrete]
  1167. // CHECK:STDOUT: %bound_method.8cf: <bound method> = bound_method %N.51e, %Int.as.Copy.impl.Op.specific_fn [symbolic]
  1168. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1169. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1170. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  1171. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  1172. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  1173. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  1174. // CHECK:STDOUT: %tuple.type.8d4: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  1175. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  1176. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  1177. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  1178. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  1179. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  1180. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1181. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  1182. // CHECK:STDOUT: %facet_value: %type_where = facet_value %array_type.002, () [concrete]
  1183. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
  1184. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.f70: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.1b2 = struct_value () [concrete]
  1185. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value) [concrete]
  1186. // CHECK:STDOUT: }
  1187. // CHECK:STDOUT:
  1188. // CHECK:STDOUT: imports {
  1189. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1190. // CHECK:STDOUT: .Int = %Core.Int
  1191. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1192. // CHECK:STDOUT: .Copy = %Core.Copy
  1193. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1194. // CHECK:STDOUT: import Core//prelude
  1195. // CHECK:STDOUT: import Core//prelude/...
  1196. // CHECK:STDOUT: }
  1197. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1198. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1199. // CHECK:STDOUT: %Core.import_ref.25c: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.543) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.c08)]
  1200. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.e99 = impl_witness_table (%Core.import_ref.25c), @Int.as.ImplicitAs.impl [concrete]
  1201. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  1202. // CHECK:STDOUT: %Core.import_ref.d0f6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.afd) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.6cd)]
  1203. // CHECK:STDOUT: %Copy.impl_witness_table.1ed = impl_witness_table (%Core.import_ref.d0f6), @Int.as.Copy.impl [concrete]
  1204. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1205. // CHECK:STDOUT: }
  1206. // CHECK:STDOUT:
  1207. // CHECK:STDOUT: file {
  1208. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1209. // CHECK:STDOUT: .Core = imports.%Core
  1210. // CHECK:STDOUT: .C = %C.decl
  1211. // CHECK:STDOUT: .F = %F.decl
  1212. // CHECK:STDOUT: .G = %G.decl
  1213. // CHECK:STDOUT: }
  1214. // CHECK:STDOUT: %Core.import = import Core
  1215. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1216. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  1217. // CHECK:STDOUT: %N.patt: %pattern_type.7ce = symbolic_binding_pattern N, 0 [concrete]
  1218. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.9a8) = binding_pattern a [concrete]
  1219. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.9a8) = value_param_pattern %a.patt, call_param0 [concrete]
  1220. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1221. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1222. // CHECK:STDOUT: } {
  1223. // CHECK:STDOUT: %int_32.loc6_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1224. // CHECK:STDOUT: %i32.loc6_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1225. // CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [concrete = constants.%i32] {
  1226. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  1227. // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1228. // CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1229. // CHECK:STDOUT: }
  1230. // CHECK:STDOUT: %N.loc6_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1231. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_28.1 (%array_type.566) = value_param call_param0
  1232. // CHECK:STDOUT: %.loc6_28: type = splice_block %array_type.loc6_28.2 [symbolic = %array_type.loc6_28.1 (constants.%array_type.566)] {
  1233. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1234. // CHECK:STDOUT: %N.ref.loc6_27: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1235. // CHECK:STDOUT: %impl.elem0.loc6_27: %.81e = impl_witness_access constants.%ImplicitAs.impl_witness.6bf, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.b09]
  1236. // CHECK:STDOUT: %bound_method.loc6_27.2: <bound method> = bound_method %N.ref.loc6_27, %impl.elem0.loc6_27 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)]
  1237. // CHECK:STDOUT: %specific_fn.loc6_27: <specific function> = specific_function %impl.elem0.loc6_27, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn]
  1238. // CHECK:STDOUT: %bound_method.loc6_27.3: <bound method> = bound_method %N.ref.loc6_27, %specific_fn.loc6_27 [symbolic = %bound_method.loc6_27.1 (constants.%bound_method.b86)]
  1239. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.2: init Core.IntLiteral = call %bound_method.loc6_27.3(%N.ref.loc6_27) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1240. // CHECK:STDOUT: %.loc6_27.1: Core.IntLiteral = value_of_initializer %Int.as.ImplicitAs.impl.Convert.call.loc6_27.2 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1241. // CHECK:STDOUT: %.loc6_27.2: Core.IntLiteral = converted %N.ref.loc6_27, %.loc6_27.1 [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1242. // CHECK:STDOUT: %array_type.loc6_28.2: type = array_type %.loc6_27.2, %C.ref [symbolic = %array_type.loc6_28.1 (constants.%array_type.566)]
  1243. // CHECK:STDOUT: }
  1244. // CHECK:STDOUT: %a: @F.%array_type.loc6_28.1 (%array_type.566) = bind_name a, %a.param
  1245. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1246. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1247. // CHECK:STDOUT: }
  1248. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1249. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1250. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  1251. // CHECK:STDOUT: } {
  1252. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1253. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1254. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  1255. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1256. // CHECK:STDOUT: }
  1257. // CHECK:STDOUT: }
  1258. // CHECK:STDOUT:
  1259. // CHECK:STDOUT: class @C {
  1260. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1261. // CHECK:STDOUT: complete_type_witness = %complete_type
  1262. // CHECK:STDOUT:
  1263. // CHECK:STDOUT: !members:
  1264. // CHECK:STDOUT: .Self = constants.%C
  1265. // CHECK:STDOUT: }
  1266. // CHECK:STDOUT:
  1267. // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: %i32) {
  1268. // CHECK:STDOUT: %N.loc6_6.1: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1269. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.ImplicitAs.impl.Convert.b09 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)]
  1270. // CHECK:STDOUT: %bound_method.loc6_27.1: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic = %bound_method.loc6_27.1 (constants.%bound_method.b86)]
  1271. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1: init Core.IntLiteral = call %bound_method.loc6_27.1(%N.loc6_6.1) [symbolic = %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 (constants.%Int.as.ImplicitAs.impl.Convert.call)]
  1272. // CHECK:STDOUT: %array_type.loc6_28.1: type = array_type %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1, constants.%C [symbolic = %array_type.loc6_28.1 (constants.%array_type.566)]
  1273. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_28.1 [symbolic = %pattern_type (constants.%pattern_type.9a8)]
  1274. // CHECK:STDOUT:
  1275. // CHECK:STDOUT: !definition:
  1276. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_28.1 [symbolic = %require_complete (constants.%require_complete.0fa)]
  1277. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.f59 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound)]
  1278. // CHECK:STDOUT: %bound_method.loc6_47.3: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.Copy.impl.Op.specific_fn [symbolic = %bound_method.loc6_47.3 (constants.%bound_method.8cf)]
  1279. // CHECK:STDOUT:
  1280. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_28.1 (%array_type.566)) -> %i32 {
  1281. // CHECK:STDOUT: !entry:
  1282. // CHECK:STDOUT: %N.ref.loc6_47: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1283. // CHECK:STDOUT: %impl.elem0.loc6_47: %.7fa = impl_witness_access constants.%Copy.impl_witness.a32, element0 [concrete = constants.%Int.as.Copy.impl.Op.f59]
  1284. // CHECK:STDOUT: %bound_method.loc6_47.1: <bound method> = bound_method %N.ref.loc6_47, %impl.elem0.loc6_47 [symbolic = %Int.as.Copy.impl.Op.bound (constants.%Int.as.Copy.impl.Op.bound)]
  1285. // CHECK:STDOUT: %specific_fn.loc6_47: <specific function> = specific_function %impl.elem0.loc6_47, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  1286. // CHECK:STDOUT: %bound_method.loc6_47.2: <bound method> = bound_method %N.ref.loc6_47, %specific_fn.loc6_47 [symbolic = %bound_method.loc6_47.3 (constants.%bound_method.8cf)]
  1287. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_47.2(%N.ref.loc6_47) [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1288. // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return
  1289. // CHECK:STDOUT: }
  1290. // CHECK:STDOUT: }
  1291. // CHECK:STDOUT:
  1292. // CHECK:STDOUT: fn @G() -> %i32 {
  1293. // CHECK:STDOUT: !entry:
  1294. // CHECK:STDOUT: name_binding_decl {
  1295. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  1296. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  1297. // CHECK:STDOUT: }
  1298. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  1299. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal ()
  1300. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal ()
  1301. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal ()
  1302. // CHECK:STDOUT: %.loc9_35.1: %tuple.type.8d4 = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
  1303. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  1304. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  1305. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  1306. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  1307. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1308. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  1309. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  1310. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  1311. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  1312. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  1313. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  1314. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  1315. // CHECK:STDOUT: %.loc9_35.8: init %array_type.002 = array_init (%.loc9_35.3, %.loc9_35.5, %.loc9_35.7) to %a.var [concrete = constants.%array]
  1316. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  1317. // CHECK:STDOUT: assign %a.var, %.loc9_3
  1318. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  1319. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1320. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  1321. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  1322. // CHECK:STDOUT: }
  1323. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  1324. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  1325. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  1326. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70
  1327. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.f70, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn]
  1328. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
  1329. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  1330. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  1331. // CHECK:STDOUT: return <error> to %return
  1332. // CHECK:STDOUT: }
  1333. // CHECK:STDOUT:
  1334. // CHECK:STDOUT: specific @F(constants.%N.51e) {
  1335. // CHECK:STDOUT: %N.loc6_6.1 => constants.%N.51e
  1336. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound
  1337. // CHECK:STDOUT: %bound_method.loc6_27.1 => constants.%bound_method.b86
  1338. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 => constants.%Int.as.ImplicitAs.impl.Convert.call
  1339. // CHECK:STDOUT: %array_type.loc6_28.1 => constants.%array_type.566
  1340. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9a8
  1341. // CHECK:STDOUT: }
  1342. // CHECK:STDOUT: