array.carbon 118 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568
  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 a[0]; }
  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 a[0]; }
  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 a[0]; }
  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: %Destroy.type: type = facet_type <@Destroy> [concrete]
  102. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  103. // CHECK:STDOUT: %Destroy.impl_witness.edd: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  104. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  105. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  106. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  107. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  108. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  109. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  110. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  111. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  112. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  113. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  114. // CHECK:STDOUT: %array_type.743: type = array_type %int_3, %T [symbolic]
  115. // CHECK:STDOUT: %pattern_type.58b: type = pattern_type %array_type.743 [symbolic]
  116. // CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic]
  117. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  118. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  119. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  120. // CHECK:STDOUT: %require_complete.06f: <witness> = require_complete_type %array_type.743 [symbolic]
  121. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  122. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  123. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  124. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  125. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  126. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  127. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  128. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  129. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  130. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  131. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  132. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.f06: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9 = struct_value () [symbolic]
  133. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  134. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.035: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  135. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.956: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.035 = struct_value () [concrete]
  136. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  137. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  138. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.956 [concrete]
  139. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.956, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  140. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  141. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  142. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  143. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  144. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  145. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  146. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  147. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  148. // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  149. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  150. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  151. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  152. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  153. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%C) [concrete]
  154. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.85d: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%array_type.002) [concrete]
  155. // CHECK:STDOUT: %T.as.Destroy.impl.Op.1f9: %T.as.Destroy.impl.Op.type.85d = struct_value () [concrete]
  156. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(%array_type.002) [concrete]
  157. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  158. // CHECK:STDOUT: }
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: imports {
  161. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  162. // CHECK:STDOUT: .Destroy = %Core.Destroy
  163. // CHECK:STDOUT: .Int = %Core.Int
  164. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  165. // CHECK:STDOUT: import Core//prelude
  166. // CHECK:STDOUT: import Core//prelude/...
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  169. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  170. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  171. // CHECK:STDOUT: %Core.import_ref.a5b: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f06)]
  172. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: file {
  176. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  177. // CHECK:STDOUT: .Core = imports.%Core
  178. // CHECK:STDOUT: .C = %C.decl
  179. // CHECK:STDOUT: .F = %F.decl
  180. // CHECK:STDOUT: .G = %G.decl
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT: %Core.import = import Core
  183. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  184. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  185. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  186. // CHECK:STDOUT: %a.patt: @F.%pattern_type.loc6_16 (%pattern_type.58b) = binding_pattern a [concrete]
  187. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc6_16 (%pattern_type.58b) = value_param_pattern %a.patt, call_param0 [concrete]
  188. // CHECK:STDOUT: %return.patt: @F.%pattern_type.loc6_32 (%pattern_type.7dcd0a.1) = return_slot_pattern [concrete]
  189. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type.loc6_32 (%pattern_type.7dcd0a.1) = out_param_pattern %return.patt, call_param1 [concrete]
  190. // CHECK:STDOUT: } {
  191. // CHECK:STDOUT: %T.ref.loc6_35: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  192. // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  193. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_29.1 (%array_type.743) = value_param call_param0
  194. // CHECK:STDOUT: %.loc6_29: type = splice_block %array_type.loc6_29.2 [symbolic = %array_type.loc6_29.1 (constants.%array_type.743)] {
  195. // CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  196. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  197. // 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)]
  198. // CHECK:STDOUT: }
  199. // CHECK:STDOUT: %a: @F.%array_type.loc6_29.1 (%array_type.743) = bind_name a, %a.param
  200. // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.1 (%T) = out_param call_param1
  201. // CHECK:STDOUT: %return: ref @F.%T.loc6_6.1 (%T) = return_slot %return.param
  202. // CHECK:STDOUT: }
  203. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  204. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  205. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param0 [concrete]
  206. // CHECK:STDOUT: } {
  207. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  208. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  209. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  210. // CHECK:STDOUT: }
  211. // CHECK:STDOUT: }
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: impl @C.as.Destroy.impl: constants.%C as constants.%Destroy.type {
  214. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  215. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  216. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  217. // CHECK:STDOUT: %.loc4: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  218. // CHECK:STDOUT: } {
  219. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  220. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  221. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: !members:
  225. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  226. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  227. // CHECK:STDOUT: }
  228. // CHECK:STDOUT:
  229. // CHECK:STDOUT: class @C {
  230. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  231. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  232. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.edd]
  233. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  234. // CHECK:STDOUT: complete_type_witness = %complete_type
  235. // CHECK:STDOUT:
  236. // CHECK:STDOUT: !members:
  237. // CHECK:STDOUT: .Self = constants.%C
  238. // CHECK:STDOUT: }
  239. // CHECK:STDOUT:
  240. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  241. // CHECK:STDOUT:
  242. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type) {
  243. // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  244. // 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)]
  245. // CHECK:STDOUT: %pattern_type.loc6_16: type = pattern_type %array_type.loc6_29.1 [symbolic = %pattern_type.loc6_16 (constants.%pattern_type.58b)]
  246. // CHECK:STDOUT: %pattern_type.loc6_32: type = pattern_type %T.loc6_6.1 [symbolic = %pattern_type.loc6_32 (constants.%pattern_type.7dcd0a.1)]
  247. // CHECK:STDOUT:
  248. // CHECK:STDOUT: !definition:
  249. // CHECK:STDOUT: %require_complete.loc6_32: <witness> = require_complete_type %T.loc6_6.1 [symbolic = %require_complete.loc6_32 (constants.%require_complete.4ae)]
  250. // CHECK:STDOUT: %require_complete.loc6_17: <witness> = require_complete_type %array_type.loc6_29.1 [symbolic = %require_complete.loc6_17 (constants.%require_complete.06f)]
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_29.1 (%array_type.743)) -> @F.%T.loc6_6.1 (%T) {
  253. // CHECK:STDOUT: !entry:
  254. // CHECK:STDOUT: %a.ref: @F.%array_type.loc6_29.1 (%array_type.743) = name_ref a, %a
  255. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  256. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  257. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  258. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
  259. // CHECK:STDOUT: %bound_method.loc6_48.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  260. // 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]
  261. // CHECK:STDOUT: %bound_method.loc6_48.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
  262. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc6_48.2(%int_0) [concrete = constants.%int_0.6a9]
  263. // CHECK:STDOUT: %.loc6_48.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9]
  264. // CHECK:STDOUT: %.loc6_48.2: %i32 = converted %int_0, %.loc6_48.1 [concrete = constants.%int_0.6a9]
  265. // CHECK:STDOUT: %.loc6_49.1: ref @F.%array_type.loc6_29.1 (%array_type.743) = value_as_ref %a.ref
  266. // CHECK:STDOUT: %.loc6_49.2: ref @F.%T.loc6_6.1 (%T) = array_index %.loc6_49.1, %.loc6_48.2
  267. // CHECK:STDOUT: %.loc6_49.3: @F.%T.loc6_6.1 (%T) = bind_value %.loc6_49.2
  268. // CHECK:STDOUT: return %.loc6_49.3
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: fn @G() -> %return.param: %C {
  273. // CHECK:STDOUT: !entry:
  274. // CHECK:STDOUT: name_binding_decl {
  275. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  276. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  279. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal ()
  280. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal ()
  281. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal ()
  282. // CHECK:STDOUT: %.loc9_35.1: %tuple.type = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
  283. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  284. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  285. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  286. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  287. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  288. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  289. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  290. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  291. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  292. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  293. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  294. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  295. // 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]
  296. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  297. // CHECK:STDOUT: assign %a.var, %.loc9_3
  298. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  299. // CHECK:STDOUT: %C.ref.loc9: type = name_ref C, file.%C.decl [concrete = constants.%C]
  300. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  301. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref.loc9 [concrete = constants.%array_type.002]
  302. // CHECK:STDOUT: }
  303. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  304. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  305. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  306. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn]
  307. // CHECK:STDOUT: %.loc8: ref %C = splice_block %return {}
  308. // CHECK:STDOUT: %.loc10: %array_type.002 = bind_value %a.ref
  309. // CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(%.loc10) to %.loc8
  310. // CHECK:STDOUT: %C.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8, constants.%C.as.Destroy.impl.Op
  311. // CHECK:STDOUT: %addr.loc8: %ptr.019 = addr_of %.loc8
  312. // CHECK:STDOUT: %C.as.Destroy.impl.Op.call: init %empty_tuple.type = call %C.as.Destroy.impl.Op.bound(%addr.loc8)
  313. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.1f9
  314. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(constants.%array_type.002) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  315. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn
  316. // CHECK:STDOUT: %addr.loc9: %ptr.301 = addr_of %a.var
  317. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc9)
  318. // CHECK:STDOUT: return %F.call to %return
  319. // CHECK:STDOUT: }
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: specific @F(constants.%T) {
  322. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  323. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.743
  324. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.58b
  325. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.7dcd0a.1
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT:
  328. // CHECK:STDOUT: specific @F(constants.%C) {
  329. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  330. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.002
  331. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.a63
  332. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.c48
  333. // CHECK:STDOUT:
  334. // CHECK:STDOUT: !definition:
  335. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%complete_type.357
  336. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.dd1
  337. // CHECK:STDOUT: }
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: --- bound_only.carbon
  340. // CHECK:STDOUT:
  341. // CHECK:STDOUT: constants {
  342. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  343. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  344. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  345. // CHECK:STDOUT: %Destroy.impl_witness.edd: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  346. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  347. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  348. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  349. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  350. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  351. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  352. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  353. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  354. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  355. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  356. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  357. // CHECK:STDOUT: %array_type.6a2: type = array_type %N, %C [symbolic]
  358. // CHECK:STDOUT: %pattern_type.9ee: type = pattern_type %array_type.6a2 [symbolic]
  359. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  360. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  361. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  362. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  363. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  364. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  365. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  366. // CHECK:STDOUT: %require_complete.d82: <witness> = require_complete_type %array_type.6a2 [symbolic]
  367. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  368. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  369. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  370. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  371. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  372. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  373. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.f06: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9 = struct_value () [symbolic]
  374. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  375. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.035: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  376. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.956: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.035 = struct_value () [concrete]
  377. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  378. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  379. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.41f: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.956 [symbolic]
  380. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.956, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  381. // CHECK:STDOUT: %bound_method.ad4: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  382. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.ad4(%N) [symbolic]
  383. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  384. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  385. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  386. // CHECK:STDOUT: %array_type.002: type = array_type %int_3.1ba, %C [concrete]
  387. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  388. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  389. // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  390. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  391. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  392. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  393. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  394. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  395. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_3.1ba) [concrete]
  396. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.85d: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%array_type.002) [concrete]
  397. // CHECK:STDOUT: %T.as.Destroy.impl.Op.1f9: %T.as.Destroy.impl.Op.type.85d = struct_value () [concrete]
  398. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(%array_type.002) [concrete]
  399. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  400. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.956 [concrete]
  401. // CHECK:STDOUT: %bound_method.047: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  402. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  403. // CHECK:STDOUT: }
  404. // CHECK:STDOUT:
  405. // CHECK:STDOUT: imports {
  406. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  407. // CHECK:STDOUT: .Destroy = %Core.Destroy
  408. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  409. // CHECK:STDOUT: .Int = %Core.Int
  410. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  411. // CHECK:STDOUT: import Core//prelude
  412. // CHECK:STDOUT: import Core//prelude/...
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  415. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  416. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  417. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  418. // CHECK:STDOUT: %Core.import_ref.a5b: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f06)]
  419. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  420. // CHECK:STDOUT: }
  421. // CHECK:STDOUT:
  422. // CHECK:STDOUT: file {
  423. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  424. // CHECK:STDOUT: .Core = imports.%Core
  425. // CHECK:STDOUT: .C = %C.decl
  426. // CHECK:STDOUT: .F = %F.decl
  427. // CHECK:STDOUT: .G = %G.decl
  428. // CHECK:STDOUT: }
  429. // CHECK:STDOUT: %Core.import = import Core
  430. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  431. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  432. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete]
  433. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.9ee) = binding_pattern a [concrete]
  434. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.9ee) = value_param_pattern %a.patt, call_param0 [concrete]
  435. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  436. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  437. // CHECK:STDOUT: } {
  438. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  439. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  440. // CHECK:STDOUT: %.loc6_26.1: type = splice_block %.loc6_26.3 [concrete = Core.IntLiteral] {
  441. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  442. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  443. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  444. // CHECK:STDOUT: %.loc6_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  445. // CHECK:STDOUT: %.loc6_26.3: type = converted %IntLiteral.call, %.loc6_26.2 [concrete = Core.IntLiteral]
  446. // CHECK:STDOUT: }
  447. // CHECK:STDOUT: %N.loc6_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.1 (constants.%N)]
  448. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_42.1 (%array_type.6a2) = value_param call_param0
  449. // CHECK:STDOUT: %.loc6_42: type = splice_block %array_type.loc6_42.2 [symbolic = %array_type.loc6_42.1 (constants.%array_type.6a2)] {
  450. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  451. // CHECK:STDOUT: %N.ref.loc6_41: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)]
  452. // 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)]
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT: %a: @F.%array_type.loc6_42.1 (%array_type.6a2) = bind_name a, %a.param
  455. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  456. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  457. // CHECK:STDOUT: }
  458. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  459. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  460. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  461. // CHECK:STDOUT: } {
  462. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  463. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  464. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  465. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  466. // CHECK:STDOUT: }
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT:
  469. // CHECK:STDOUT: impl @C.as.Destroy.impl: constants.%C as constants.%Destroy.type {
  470. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  471. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  472. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  473. // CHECK:STDOUT: %.loc4: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  474. // CHECK:STDOUT: } {
  475. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  476. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  477. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  478. // CHECK:STDOUT: }
  479. // CHECK:STDOUT:
  480. // CHECK:STDOUT: !members:
  481. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  482. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  483. // CHECK:STDOUT: }
  484. // CHECK:STDOUT:
  485. // CHECK:STDOUT: class @C {
  486. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  487. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  488. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.edd]
  489. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  490. // CHECK:STDOUT: complete_type_witness = %complete_type
  491. // CHECK:STDOUT:
  492. // CHECK:STDOUT: !members:
  493. // CHECK:STDOUT: .Self = constants.%C
  494. // CHECK:STDOUT: }
  495. // CHECK:STDOUT:
  496. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  497. // CHECK:STDOUT:
  498. // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: Core.IntLiteral) {
  499. // CHECK:STDOUT: %N.loc6_6.1: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.1 (constants.%N)]
  500. // 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)]
  501. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_42.1 [symbolic = %pattern_type (constants.%pattern_type.9ee)]
  502. // CHECK:STDOUT:
  503. // CHECK:STDOUT: !definition:
  504. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_42.1 [symbolic = %require_complete (constants.%require_complete.d82)]
  505. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc6_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.41f)]
  506. // 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.ad4)]
  507. // 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)]
  508. // CHECK:STDOUT:
  509. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_42.1 (%array_type.6a2)) -> %i32 {
  510. // CHECK:STDOUT: !entry:
  511. // CHECK:STDOUT: %N.ref.loc6_61: Core.IntLiteral = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N)]
  512. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
  513. // 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.41f)]
  514. // 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]
  515. // 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.ad4)]
  516. // 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)]
  517. // CHECK:STDOUT: %.loc6_62.1: %i32 = value_of_initializer %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)]
  518. // CHECK:STDOUT: %.loc6_62.2: %i32 = converted %N.ref.loc6_61, %.loc6_62.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  519. // CHECK:STDOUT: return %.loc6_62.2
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT: }
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: fn @G() -> %i32 {
  524. // CHECK:STDOUT: !entry:
  525. // CHECK:STDOUT: name_binding_decl {
  526. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  527. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  530. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal ()
  531. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal ()
  532. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal ()
  533. // CHECK:STDOUT: %.loc9_35.1: %tuple.type = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
  534. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  535. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  536. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  537. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  538. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  539. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  540. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  541. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  542. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  543. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  544. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  545. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  546. // 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]
  547. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  548. // CHECK:STDOUT: assign %a.var, %.loc9_3
  549. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  550. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  551. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  552. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  555. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  556. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  557. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn]
  558. // CHECK:STDOUT: %.loc10_12: %array_type.002 = bind_value %a.ref
  559. // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%.loc10_12)
  560. // CHECK:STDOUT: %.loc10_14.1: %i32 = value_of_initializer %F.call
  561. // CHECK:STDOUT: %.loc10_14.2: %i32 = converted %F.call, %.loc10_14.1
  562. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.1f9
  563. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(constants.%array_type.002) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  564. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn
  565. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  566. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  567. // CHECK:STDOUT: return %.loc10_14.2
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: specific @F(constants.%N) {
  571. // CHECK:STDOUT: %N.loc6_6.1 => constants.%N
  572. // CHECK:STDOUT: %array_type.loc6_42.1 => constants.%array_type.6a2
  573. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9ee
  574. // CHECK:STDOUT: }
  575. // CHECK:STDOUT:
  576. // CHECK:STDOUT: specific @F(constants.%int_3.1ba) {
  577. // CHECK:STDOUT: %N.loc6_6.1 => constants.%int_3.1ba
  578. // CHECK:STDOUT: %array_type.loc6_42.1 => constants.%array_type.002
  579. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  580. // CHECK:STDOUT:
  581. // CHECK:STDOUT: !definition:
  582. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  583. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b30
  584. // CHECK:STDOUT: %bound_method.loc6_62.3 => constants.%bound_method.047
  585. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc6_62.2 => constants.%int_3.822
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: --- type_and_bound.carbon
  589. // CHECK:STDOUT:
  590. // CHECK:STDOUT: constants {
  591. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  592. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  593. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  594. // CHECK:STDOUT: %Destroy.impl_witness.edd: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  595. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  596. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  597. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  598. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  599. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  600. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  601. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  602. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  603. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  604. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  605. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  606. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 1 [symbolic]
  607. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  608. // CHECK:STDOUT: %array_type.bb5: type = array_type %N, %T [symbolic]
  609. // CHECK:STDOUT: %pattern_type.261: type = pattern_type %array_type.bb5 [symbolic]
  610. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  611. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  612. // CHECK:STDOUT: %require_complete.ec9: <witness> = require_complete_type %array_type.bb5 [symbolic]
  613. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  614. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  615. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  616. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  617. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  618. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  619. // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  620. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  621. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  622. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  623. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  624. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  625. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%C, %int_3) [concrete]
  626. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.85d: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%array_type.002) [concrete]
  627. // CHECK:STDOUT: %T.as.Destroy.impl.Op.1f9: %T.as.Destroy.impl.Op.type.85d = struct_value () [concrete]
  628. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(%array_type.002) [concrete]
  629. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  630. // CHECK:STDOUT: }
  631. // CHECK:STDOUT:
  632. // CHECK:STDOUT: imports {
  633. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  634. // CHECK:STDOUT: .Destroy = %Core.Destroy
  635. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  636. // CHECK:STDOUT: import Core//prelude
  637. // CHECK:STDOUT: import Core//prelude/...
  638. // CHECK:STDOUT: }
  639. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  640. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  641. // CHECK:STDOUT: }
  642. // CHECK:STDOUT:
  643. // CHECK:STDOUT: file {
  644. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  645. // CHECK:STDOUT: .Core = imports.%Core
  646. // CHECK:STDOUT: .C = %C.decl
  647. // CHECK:STDOUT: .F = %F.decl
  648. // CHECK:STDOUT: .G = %G.decl
  649. // CHECK:STDOUT: }
  650. // CHECK:STDOUT: %Core.import = import Core
  651. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  652. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  653. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  654. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 1 [concrete]
  655. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.261) = binding_pattern a [concrete]
  656. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.261) = value_param_pattern %a.patt, call_param0 [concrete]
  657. // CHECK:STDOUT: } {
  658. // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  659. // CHECK:STDOUT: %.loc6_36.1: type = splice_block %.loc6_36.3 [concrete = Core.IntLiteral] {
  660. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  661. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  662. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  663. // CHECK:STDOUT: %.loc6_36.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  664. // CHECK:STDOUT: %.loc6_36.3: type = converted %IntLiteral.call, %.loc6_36.2 [concrete = Core.IntLiteral]
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT: %N.loc6_16.2: Core.IntLiteral = bind_symbolic_name N, 1 [symbolic = %N.loc6_16.1 (constants.%N)]
  667. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_52.1 (%array_type.bb5) = value_param call_param0
  668. // CHECK:STDOUT: %.loc6_52: type = splice_block %array_type.loc6_52.2 [symbolic = %array_type.loc6_52.1 (constants.%array_type.bb5)] {
  669. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  670. // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc6_16.2 [symbolic = %N.loc6_16.1 (constants.%N)]
  671. // CHECK:STDOUT: %array_type.loc6_52.2: type = array_type %N.ref, %T.ref [symbolic = %array_type.loc6_52.1 (constants.%array_type.bb5)]
  672. // CHECK:STDOUT: }
  673. // CHECK:STDOUT: %a: @F.%array_type.loc6_52.1 (%array_type.bb5) = bind_name a, %a.param
  674. // CHECK:STDOUT: }
  675. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  676. // CHECK:STDOUT: }
  677. // CHECK:STDOUT:
  678. // CHECK:STDOUT: impl @C.as.Destroy.impl: constants.%C as constants.%Destroy.type {
  679. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  680. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  681. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  682. // CHECK:STDOUT: %.loc4: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  683. // CHECK:STDOUT: } {
  684. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  685. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  686. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  687. // CHECK:STDOUT: }
  688. // CHECK:STDOUT:
  689. // CHECK:STDOUT: !members:
  690. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  691. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  692. // CHECK:STDOUT: }
  693. // CHECK:STDOUT:
  694. // CHECK:STDOUT: class @C {
  695. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  696. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  697. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.edd]
  698. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  699. // CHECK:STDOUT: complete_type_witness = %complete_type
  700. // CHECK:STDOUT:
  701. // CHECK:STDOUT: !members:
  702. // CHECK:STDOUT: .Self = constants.%C
  703. // CHECK:STDOUT: }
  704. // CHECK:STDOUT:
  705. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  706. // CHECK:STDOUT:
  707. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type, %N.loc6_16.2: Core.IntLiteral) {
  708. // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  709. // CHECK:STDOUT: %N.loc6_16.1: Core.IntLiteral = bind_symbolic_name N, 1 [symbolic = %N.loc6_16.1 (constants.%N)]
  710. // 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)]
  711. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_52.1 [symbolic = %pattern_type (constants.%pattern_type.261)]
  712. // CHECK:STDOUT:
  713. // CHECK:STDOUT: !definition:
  714. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_52.1 [symbolic = %require_complete (constants.%require_complete.ec9)]
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_52.1 (%array_type.bb5)) {
  717. // CHECK:STDOUT: !entry:
  718. // CHECK:STDOUT: return
  719. // CHECK:STDOUT: }
  720. // CHECK:STDOUT: }
  721. // CHECK:STDOUT:
  722. // CHECK:STDOUT: fn @G() {
  723. // CHECK:STDOUT: !entry:
  724. // CHECK:STDOUT: name_binding_decl {
  725. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  726. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  727. // CHECK:STDOUT: }
  728. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  729. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal ()
  730. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal ()
  731. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal ()
  732. // CHECK:STDOUT: %.loc9_35.1: %tuple.type = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
  733. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  734. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  735. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  736. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  737. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  738. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  739. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  740. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  741. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  742. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  743. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  744. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  745. // 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]
  746. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  747. // CHECK:STDOUT: assign %a.var, %.loc9_3
  748. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  749. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  750. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  751. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  752. // CHECK:STDOUT: }
  753. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  754. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  755. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  756. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C, constants.%int_3) [concrete = constants.%F.specific_fn]
  757. // CHECK:STDOUT: %.loc10: %array_type.002 = bind_value %a.ref
  758. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn(%.loc10)
  759. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.1f9
  760. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(constants.%array_type.002) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  761. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn
  762. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  763. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  764. // CHECK:STDOUT: return
  765. // CHECK:STDOUT: }
  766. // CHECK:STDOUT:
  767. // CHECK:STDOUT: specific @F(constants.%T, constants.%N) {
  768. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  769. // CHECK:STDOUT: %N.loc6_16.1 => constants.%N
  770. // CHECK:STDOUT: %array_type.loc6_52.1 => constants.%array_type.bb5
  771. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.261
  772. // CHECK:STDOUT: }
  773. // CHECK:STDOUT:
  774. // CHECK:STDOUT: specific @F(constants.%C, constants.%int_3) {
  775. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  776. // CHECK:STDOUT: %N.loc6_16.1 => constants.%int_3
  777. // CHECK:STDOUT: %array_type.loc6_52.1 => constants.%array_type.002
  778. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  779. // CHECK:STDOUT:
  780. // CHECK:STDOUT: !definition:
  781. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  782. // CHECK:STDOUT: }
  783. // CHECK:STDOUT:
  784. // CHECK:STDOUT: --- fail_bound_mismatch.carbon
  785. // CHECK:STDOUT:
  786. // CHECK:STDOUT: constants {
  787. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  788. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  789. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  790. // CHECK:STDOUT: %Destroy.impl_witness.edd: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  791. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  792. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  793. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  794. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  795. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  796. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  797. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  798. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  799. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  800. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  801. // CHECK:STDOUT: %array_type.9d4: type = array_type %int_2, %T [symbolic]
  802. // CHECK:STDOUT: %pattern_type.a4c: type = pattern_type %array_type.9d4 [symbolic]
  803. // CHECK:STDOUT: %pattern_type.7dcd0a.1: type = pattern_type %T [symbolic]
  804. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  805. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  806. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  807. // CHECK:STDOUT: %require_complete.d11: <witness> = require_complete_type %array_type.9d4 [symbolic]
  808. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  809. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  810. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  811. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  812. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  813. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  814. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  815. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  816. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  817. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  818. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  819. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.f06: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9 = struct_value () [symbolic]
  820. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  821. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.035: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  822. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.956: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.035 = struct_value () [concrete]
  823. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  824. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  825. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.956 [concrete]
  826. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.956, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  827. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  828. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  829. // CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete]
  830. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  831. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  832. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  833. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  834. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  835. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  836. // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  837. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  838. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  839. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  840. // CHECK:STDOUT: %array_type.15a: type = array_type %int_2, %C [concrete]
  841. // CHECK:STDOUT: %pattern_type.114: type = pattern_type %array_type.15a [concrete]
  842. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%C) [concrete]
  843. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.85d: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%array_type.002) [concrete]
  844. // CHECK:STDOUT: %T.as.Destroy.impl.Op.1f9: %T.as.Destroy.impl.Op.type.85d = struct_value () [concrete]
  845. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(%array_type.002) [concrete]
  846. // CHECK:STDOUT: %complete_type.8eb: <witness> = complete_type_witness %array_type.15a [concrete]
  847. // CHECK:STDOUT: }
  848. // CHECK:STDOUT:
  849. // CHECK:STDOUT: imports {
  850. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  851. // CHECK:STDOUT: .Destroy = %Core.Destroy
  852. // CHECK:STDOUT: .Int = %Core.Int
  853. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  854. // CHECK:STDOUT: import Core//prelude
  855. // CHECK:STDOUT: import Core//prelude/...
  856. // CHECK:STDOUT: }
  857. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  858. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  859. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  860. // CHECK:STDOUT: %Core.import_ref.a5b: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f06)]
  861. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  862. // CHECK:STDOUT: }
  863. // CHECK:STDOUT:
  864. // CHECK:STDOUT: file {
  865. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  866. // CHECK:STDOUT: .Core = imports.%Core
  867. // CHECK:STDOUT: .C = %C.decl
  868. // CHECK:STDOUT: .F = %F.decl
  869. // CHECK:STDOUT: .G = %G.decl
  870. // CHECK:STDOUT: }
  871. // CHECK:STDOUT: %Core.import = import Core
  872. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  873. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  874. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  875. // CHECK:STDOUT: %a.patt: @F.%pattern_type.loc6_16 (%pattern_type.a4c) = binding_pattern a [concrete]
  876. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type.loc6_16 (%pattern_type.a4c) = value_param_pattern %a.patt, call_param0 [concrete]
  877. // CHECK:STDOUT: %return.patt: @F.%pattern_type.loc6_32 (%pattern_type.7dcd0a.1) = return_slot_pattern [concrete]
  878. // CHECK:STDOUT: %return.param_patt: @F.%pattern_type.loc6_32 (%pattern_type.7dcd0a.1) = out_param_pattern %return.patt, call_param1 [concrete]
  879. // CHECK:STDOUT: } {
  880. // CHECK:STDOUT: %T.ref.loc6_35: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  881. // CHECK:STDOUT: %T.loc6_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  882. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_29.1 (%array_type.9d4) = value_param call_param0
  883. // CHECK:STDOUT: %.loc6_29: type = splice_block %array_type.loc6_29.2 [symbolic = %array_type.loc6_29.1 (constants.%array_type.9d4)] {
  884. // CHECK:STDOUT: %T.ref.loc6_25: type = name_ref T, %T.loc6_6.2 [symbolic = %T.loc6_6.1 (constants.%T)]
  885. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  886. // 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)]
  887. // CHECK:STDOUT: }
  888. // CHECK:STDOUT: %a: @F.%array_type.loc6_29.1 (%array_type.9d4) = bind_name a, %a.param
  889. // CHECK:STDOUT: %return.param: ref @F.%T.loc6_6.1 (%T) = out_param call_param1
  890. // CHECK:STDOUT: %return: ref @F.%T.loc6_6.1 (%T) = return_slot %return.param
  891. // CHECK:STDOUT: }
  892. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  893. // CHECK:STDOUT: %return.patt: %pattern_type.c48 = return_slot_pattern [concrete]
  894. // CHECK:STDOUT: %return.param_patt: %pattern_type.c48 = out_param_pattern %return.patt, call_param0 [concrete]
  895. // CHECK:STDOUT: } {
  896. // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, file.%C.decl [concrete = constants.%C]
  897. // CHECK:STDOUT: %return.param: ref %C = out_param call_param0
  898. // CHECK:STDOUT: %return: ref %C = return_slot %return.param
  899. // CHECK:STDOUT: }
  900. // CHECK:STDOUT: }
  901. // CHECK:STDOUT:
  902. // CHECK:STDOUT: impl @C.as.Destroy.impl: constants.%C as constants.%Destroy.type {
  903. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  904. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  905. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  906. // CHECK:STDOUT: %.loc4: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  907. // CHECK:STDOUT: } {
  908. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  909. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  910. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  911. // CHECK:STDOUT: }
  912. // CHECK:STDOUT:
  913. // CHECK:STDOUT: !members:
  914. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  915. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  916. // CHECK:STDOUT: }
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: class @C {
  919. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  920. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  921. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.edd]
  922. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  923. // CHECK:STDOUT: complete_type_witness = %complete_type
  924. // CHECK:STDOUT:
  925. // CHECK:STDOUT: !members:
  926. // CHECK:STDOUT: .Self = constants.%C
  927. // CHECK:STDOUT: }
  928. // CHECK:STDOUT:
  929. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  930. // CHECK:STDOUT:
  931. // CHECK:STDOUT: generic fn @F(%T.loc6_6.2: type) {
  932. // CHECK:STDOUT: %T.loc6_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_6.1 (constants.%T)]
  933. // 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)]
  934. // CHECK:STDOUT: %pattern_type.loc6_16: type = pattern_type %array_type.loc6_29.1 [symbolic = %pattern_type.loc6_16 (constants.%pattern_type.a4c)]
  935. // CHECK:STDOUT: %pattern_type.loc6_32: type = pattern_type %T.loc6_6.1 [symbolic = %pattern_type.loc6_32 (constants.%pattern_type.7dcd0a.1)]
  936. // CHECK:STDOUT:
  937. // CHECK:STDOUT: !definition:
  938. // CHECK:STDOUT: %require_complete.loc6_32: <witness> = require_complete_type %T.loc6_6.1 [symbolic = %require_complete.loc6_32 (constants.%require_complete.4ae)]
  939. // CHECK:STDOUT: %require_complete.loc6_17: <witness> = require_complete_type %array_type.loc6_29.1 [symbolic = %require_complete.loc6_17 (constants.%require_complete.d11)]
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_29.1 (%array_type.9d4)) -> @F.%T.loc6_6.1 (%T) {
  942. // CHECK:STDOUT: !entry:
  943. // CHECK:STDOUT: %a.ref: @F.%array_type.loc6_29.1 (%array_type.9d4) = name_ref a, %a
  944. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  945. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  946. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  947. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
  948. // CHECK:STDOUT: %bound_method.loc6_48.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  949. // 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]
  950. // CHECK:STDOUT: %bound_method.loc6_48.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
  951. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc6_48.2(%int_0) [concrete = constants.%int_0.6a9]
  952. // CHECK:STDOUT: %.loc6_48.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.6a9]
  953. // CHECK:STDOUT: %.loc6_48.2: %i32 = converted %int_0, %.loc6_48.1 [concrete = constants.%int_0.6a9]
  954. // CHECK:STDOUT: %.loc6_49.1: ref @F.%array_type.loc6_29.1 (%array_type.9d4) = value_as_ref %a.ref
  955. // CHECK:STDOUT: %.loc6_49.2: ref @F.%T.loc6_6.1 (%T) = array_index %.loc6_49.1, %.loc6_48.2
  956. // CHECK:STDOUT: %.loc6_49.3: @F.%T.loc6_6.1 (%T) = bind_value %.loc6_49.2
  957. // CHECK:STDOUT: return %.loc6_49.3
  958. // CHECK:STDOUT: }
  959. // CHECK:STDOUT: }
  960. // CHECK:STDOUT:
  961. // CHECK:STDOUT: fn @G() -> %return.param: %C {
  962. // CHECK:STDOUT: !entry:
  963. // CHECK:STDOUT: name_binding_decl {
  964. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  965. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  966. // CHECK:STDOUT: }
  967. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  968. // CHECK:STDOUT: %.loc10_26.1: %empty_struct_type = struct_literal ()
  969. // CHECK:STDOUT: %.loc10_30.1: %empty_struct_type = struct_literal ()
  970. // CHECK:STDOUT: %.loc10_34.1: %empty_struct_type = struct_literal ()
  971. // CHECK:STDOUT: %.loc10_35.1: %tuple.type = tuple_literal (%.loc10_26.1, %.loc10_30.1, %.loc10_34.1)
  972. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  973. // CHECK:STDOUT: %.loc10_35.2: ref %C = array_index %a.var, %int_0
  974. // CHECK:STDOUT: %.loc10_26.2: init %C = class_init (), %.loc10_35.2 [concrete = constants.%C.val]
  975. // CHECK:STDOUT: %.loc10_35.3: init %C = converted %.loc10_26.1, %.loc10_26.2 [concrete = constants.%C.val]
  976. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  977. // CHECK:STDOUT: %.loc10_35.4: ref %C = array_index %a.var, %int_1
  978. // CHECK:STDOUT: %.loc10_30.2: init %C = class_init (), %.loc10_35.4 [concrete = constants.%C.val]
  979. // CHECK:STDOUT: %.loc10_35.5: init %C = converted %.loc10_30.1, %.loc10_30.2 [concrete = constants.%C.val]
  980. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  981. // CHECK:STDOUT: %.loc10_35.6: ref %C = array_index %a.var, %int_2
  982. // CHECK:STDOUT: %.loc10_34.2: init %C = class_init (), %.loc10_35.6 [concrete = constants.%C.val]
  983. // CHECK:STDOUT: %.loc10_35.7: init %C = converted %.loc10_34.1, %.loc10_34.2 [concrete = constants.%C.val]
  984. // 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]
  985. // CHECK:STDOUT: %.loc10_3: init %array_type.002 = converted %.loc10_35.1, %.loc10_35.8 [concrete = constants.%array]
  986. // CHECK:STDOUT: assign %a.var, %.loc10_3
  987. // CHECK:STDOUT: %.loc10_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  988. // CHECK:STDOUT: %C.ref.loc10: type = name_ref C, file.%C.decl [concrete = constants.%C]
  989. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  990. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref.loc10 [concrete = constants.%array_type.002]
  991. // CHECK:STDOUT: }
  992. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  993. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  994. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  995. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C) [concrete = constants.%F.specific_fn]
  996. // CHECK:STDOUT: %.loc8: ref %C = splice_block %return {}
  997. // CHECK:STDOUT: %.loc21: %array_type.15a = converted %a.ref, <error> [concrete = <error>]
  998. // CHECK:STDOUT: %F.call: init %C = call %F.specific_fn(<error>) to %.loc8
  999. // CHECK:STDOUT: %C.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc8, constants.%C.as.Destroy.impl.Op
  1000. // CHECK:STDOUT: %addr.loc8: %ptr.019 = addr_of %.loc8
  1001. // CHECK:STDOUT: %C.as.Destroy.impl.Op.call: init %empty_tuple.type = call %C.as.Destroy.impl.Op.bound(%addr.loc8)
  1002. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.1f9
  1003. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(constants.%array_type.002) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  1004. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn
  1005. // CHECK:STDOUT: %addr.loc10: %ptr.301 = addr_of %a.var
  1006. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc10)
  1007. // CHECK:STDOUT: return %F.call to %return
  1008. // CHECK:STDOUT: }
  1009. // CHECK:STDOUT:
  1010. // CHECK:STDOUT: specific @F(constants.%T) {
  1011. // CHECK:STDOUT: %T.loc6_6.1 => constants.%T
  1012. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.9d4
  1013. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.a4c
  1014. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.7dcd0a.1
  1015. // CHECK:STDOUT: }
  1016. // CHECK:STDOUT:
  1017. // CHECK:STDOUT: specific @F(constants.%C) {
  1018. // CHECK:STDOUT: %T.loc6_6.1 => constants.%C
  1019. // CHECK:STDOUT: %array_type.loc6_29.1 => constants.%array_type.15a
  1020. // CHECK:STDOUT: %pattern_type.loc6_16 => constants.%pattern_type.114
  1021. // CHECK:STDOUT: %pattern_type.loc6_32 => constants.%pattern_type.c48
  1022. // CHECK:STDOUT:
  1023. // CHECK:STDOUT: !definition:
  1024. // CHECK:STDOUT: %require_complete.loc6_32 => constants.%complete_type.357
  1025. // CHECK:STDOUT: %require_complete.loc6_17 => constants.%complete_type.8eb
  1026. // CHECK:STDOUT: }
  1027. // CHECK:STDOUT:
  1028. // CHECK:STDOUT: --- fail_type_mismatch.carbon
  1029. // CHECK:STDOUT:
  1030. // CHECK:STDOUT: constants {
  1031. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1032. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1033. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1034. // CHECK:STDOUT: %Destroy.impl_witness.edd: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  1035. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  1036. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  1037. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  1038. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1039. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  1040. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1041. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1042. // CHECK:STDOUT: %D: type = class_type @D [concrete]
  1043. // CHECK:STDOUT: %Destroy.impl_witness.73d: <witness> = impl_witness @D.%Destroy.impl_witness_table [concrete]
  1044. // CHECK:STDOUT: %ptr.19c: type = ptr_type %D [concrete]
  1045. // CHECK:STDOUT: %pattern_type.a94: type = pattern_type %ptr.19c [concrete]
  1046. // CHECK:STDOUT: %D.as.Destroy.impl.Op.type: type = fn_type @D.as.Destroy.impl.Op [concrete]
  1047. // CHECK:STDOUT: %D.as.Destroy.impl.Op: %D.as.Destroy.impl.Op.type = struct_value () [concrete]
  1048. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  1049. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  1050. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  1051. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  1052. // CHECK:STDOUT: %array_type.6a2: type = array_type %N, %C [symbolic]
  1053. // CHECK:STDOUT: %pattern_type.9ee: type = pattern_type %array_type.6a2 [symbolic]
  1054. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1055. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1056. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1057. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1058. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  1059. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1060. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1061. // CHECK:STDOUT: %require_complete.d82: <witness> = require_complete_type %array_type.6a2 [symbolic]
  1062. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1063. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1064. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  1065. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  1066. // CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
  1067. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  1068. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.f06: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9 = struct_value () [symbolic]
  1069. // CHECK:STDOUT: %ImplicitAs.impl_witness.c75: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  1070. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.035: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  1071. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.956: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.035 = struct_value () [concrete]
  1072. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete]
  1073. // CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  1074. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.41f: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.956 [symbolic]
  1075. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.956, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  1076. // CHECK:STDOUT: %bound_method.ad4: <bound method> = bound_method %N, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  1077. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.ad4(%N) [symbolic]
  1078. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1079. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1080. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  1081. // CHECK:STDOUT: %array_type.fe4: type = array_type %int_3.1ba, %D [concrete]
  1082. // CHECK:STDOUT: %ptr.af6: type = ptr_type %array_type.fe4 [concrete]
  1083. // CHECK:STDOUT: %pattern_type.f30: type = pattern_type %array_type.fe4 [concrete]
  1084. // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  1085. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  1086. // CHECK:STDOUT: %D.val: %D = struct_value () [concrete]
  1087. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  1088. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  1089. // CHECK:STDOUT: %array: %array_type.fe4 = tuple_value (%D.val, %D.val, %D.val) [concrete]
  1090. // CHECK:STDOUT: %array_type.002: type = array_type %int_3.1ba, %C [concrete]
  1091. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  1092. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_3.1ba) [concrete]
  1093. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.419: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%array_type.fe4) [concrete]
  1094. // CHECK:STDOUT: %T.as.Destroy.impl.Op.11a: %T.as.Destroy.impl.Op.type.419 = struct_value () [concrete]
  1095. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.11a, @T.as.Destroy.impl.Op(%array_type.fe4) [concrete]
  1096. // CHECK:STDOUT: %complete_type.dd1: <witness> = complete_type_witness %array_type.002 [concrete]
  1097. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.956 [concrete]
  1098. // CHECK:STDOUT: %bound_method.047: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  1099. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete]
  1100. // CHECK:STDOUT: }
  1101. // CHECK:STDOUT:
  1102. // CHECK:STDOUT: imports {
  1103. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1104. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1105. // CHECK:STDOUT: .IntLiteral = %Core.IntLiteral
  1106. // CHECK:STDOUT: .Int = %Core.Int
  1107. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1108. // CHECK:STDOUT: import Core//prelude
  1109. // CHECK:STDOUT: import Core//prelude/...
  1110. // CHECK:STDOUT: }
  1111. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1112. // CHECK:STDOUT: %Core.IntLiteral: %IntLiteral.type = import_ref Core//prelude/parts/int_literal, IntLiteral, loaded [concrete = constants.%IntLiteral]
  1113. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1114. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1115. // CHECK:STDOUT: %Core.import_ref.a5b: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f06)]
  1116. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  1117. // CHECK:STDOUT: }
  1118. // CHECK:STDOUT:
  1119. // CHECK:STDOUT: file {
  1120. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1121. // CHECK:STDOUT: .Core = imports.%Core
  1122. // CHECK:STDOUT: .C = %C.decl
  1123. // CHECK:STDOUT: .D = %D.decl
  1124. // CHECK:STDOUT: .F = %F.decl
  1125. // CHECK:STDOUT: .G = %G.decl
  1126. // CHECK:STDOUT: }
  1127. // CHECK:STDOUT: %Core.import = import Core
  1128. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1129. // CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
  1130. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  1131. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = symbolic_binding_pattern N, 0 [concrete]
  1132. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.9ee) = binding_pattern a [concrete]
  1133. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.9ee) = value_param_pattern %a.patt, call_param0 [concrete]
  1134. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1135. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1136. // CHECK:STDOUT: } {
  1137. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1138. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1139. // CHECK:STDOUT: %.loc7_26.1: type = splice_block %.loc7_26.3 [concrete = Core.IntLiteral] {
  1140. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  1141. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%Core.IntLiteral [concrete = constants.%IntLiteral]
  1142. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  1143. // CHECK:STDOUT: %.loc7_26.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  1144. // CHECK:STDOUT: %.loc7_26.3: type = converted %IntLiteral.call, %.loc7_26.2 [concrete = Core.IntLiteral]
  1145. // CHECK:STDOUT: }
  1146. // CHECK:STDOUT: %N.loc7_6.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc7_6.1 (constants.%N)]
  1147. // CHECK:STDOUT: %a.param: @F.%array_type.loc7_42.1 (%array_type.6a2) = value_param call_param0
  1148. // CHECK:STDOUT: %.loc7_42: type = splice_block %array_type.loc7_42.2 [symbolic = %array_type.loc7_42.1 (constants.%array_type.6a2)] {
  1149. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1150. // CHECK:STDOUT: %N.ref.loc7_41: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)]
  1151. // 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)]
  1152. // CHECK:STDOUT: }
  1153. // CHECK:STDOUT: %a: @F.%array_type.loc7_42.1 (%array_type.6a2) = bind_name a, %a.param
  1154. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1155. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1156. // CHECK:STDOUT: }
  1157. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1158. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1159. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  1160. // CHECK:STDOUT: } {
  1161. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1162. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1163. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  1164. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1165. // CHECK:STDOUT: }
  1166. // CHECK:STDOUT: }
  1167. // CHECK:STDOUT:
  1168. // CHECK:STDOUT: impl @C.as.Destroy.impl: constants.%C as constants.%Destroy.type {
  1169. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  1170. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  1171. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  1172. // CHECK:STDOUT: %.loc4: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1173. // CHECK:STDOUT: } {
  1174. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  1175. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1176. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  1177. // CHECK:STDOUT: }
  1178. // CHECK:STDOUT:
  1179. // CHECK:STDOUT: !members:
  1180. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  1181. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  1182. // CHECK:STDOUT: }
  1183. // CHECK:STDOUT:
  1184. // CHECK:STDOUT: impl @D.as.Destroy.impl: constants.%D as constants.%Destroy.type {
  1185. // CHECK:STDOUT: %D.as.Destroy.impl.Op.decl: %D.as.Destroy.impl.Op.type = fn_decl @D.as.Destroy.impl.Op [concrete = constants.%D.as.Destroy.impl.Op] {
  1186. // CHECK:STDOUT: %self.patt: %pattern_type.a94 = binding_pattern self [concrete]
  1187. // CHECK:STDOUT: %self.param_patt: %pattern_type.a94 = value_param_pattern %self.patt, call_param0 [concrete]
  1188. // CHECK:STDOUT: %.loc5: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1189. // CHECK:STDOUT: } {
  1190. // CHECK:STDOUT: %self.param: %ptr.19c = value_param call_param0
  1191. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
  1192. // CHECK:STDOUT: %self: %ptr.19c = bind_name self, %self.param
  1193. // CHECK:STDOUT: }
  1194. // CHECK:STDOUT:
  1195. // CHECK:STDOUT: !members:
  1196. // CHECK:STDOUT: .Op = %D.as.Destroy.impl.Op.decl
  1197. // CHECK:STDOUT: witness = @D.%Destroy.impl_witness
  1198. // CHECK:STDOUT: }
  1199. // CHECK:STDOUT:
  1200. // CHECK:STDOUT: class @C {
  1201. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  1202. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  1203. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.edd]
  1204. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1205. // CHECK:STDOUT: complete_type_witness = %complete_type
  1206. // CHECK:STDOUT:
  1207. // CHECK:STDOUT: !members:
  1208. // CHECK:STDOUT: .Self = constants.%C
  1209. // CHECK:STDOUT: }
  1210. // CHECK:STDOUT:
  1211. // CHECK:STDOUT: class @D {
  1212. // CHECK:STDOUT: impl_decl @D.as.Destroy.impl [concrete] {} {}
  1213. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@D.as.Destroy.impl.%D.as.Destroy.impl.Op.decl), @D.as.Destroy.impl [concrete]
  1214. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.73d]
  1215. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1216. // CHECK:STDOUT: complete_type_witness = %complete_type
  1217. // CHECK:STDOUT:
  1218. // CHECK:STDOUT: !members:
  1219. // CHECK:STDOUT: .Self = constants.%D
  1220. // CHECK:STDOUT: }
  1221. // CHECK:STDOUT:
  1222. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  1223. // CHECK:STDOUT:
  1224. // CHECK:STDOUT: fn @D.as.Destroy.impl.Op(%self.param: %ptr.19c) = "no_op";
  1225. // CHECK:STDOUT:
  1226. // CHECK:STDOUT: generic fn @F(%N.loc7_6.2: Core.IntLiteral) {
  1227. // CHECK:STDOUT: %N.loc7_6.1: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc7_6.1 (constants.%N)]
  1228. // 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)]
  1229. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc7_42.1 [symbolic = %pattern_type (constants.%pattern_type.9ee)]
  1230. // CHECK:STDOUT:
  1231. // CHECK:STDOUT: !definition:
  1232. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc7_42.1 [symbolic = %require_complete (constants.%require_complete.d82)]
  1233. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc7_6.1, constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.41f)]
  1234. // 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.ad4)]
  1235. // 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)]
  1236. // CHECK:STDOUT:
  1237. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc7_42.1 (%array_type.6a2)) -> %i32 {
  1238. // CHECK:STDOUT: !entry:
  1239. // CHECK:STDOUT: %N.ref.loc7_61: Core.IntLiteral = name_ref N, %N.loc7_6.2 [symbolic = %N.loc7_6.1 (constants.%N)]
  1240. // CHECK:STDOUT: %impl.elem0: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
  1241. // 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.41f)]
  1242. // 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]
  1243. // 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.ad4)]
  1244. // 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)]
  1245. // CHECK:STDOUT: %.loc7_62.1: %i32 = value_of_initializer %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)]
  1246. // CHECK:STDOUT: %.loc7_62.2: %i32 = converted %N.ref.loc7_61, %.loc7_62.1 [symbolic = %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.call)]
  1247. // CHECK:STDOUT: return %.loc7_62.2
  1248. // CHECK:STDOUT: }
  1249. // CHECK:STDOUT: }
  1250. // CHECK:STDOUT:
  1251. // CHECK:STDOUT: fn @G() -> %i32 {
  1252. // CHECK:STDOUT: !entry:
  1253. // CHECK:STDOUT: name_binding_decl {
  1254. // CHECK:STDOUT: %a.patt: %pattern_type.f30 = binding_pattern a [concrete]
  1255. // CHECK:STDOUT: %a.var_patt: %pattern_type.f30 = var_pattern %a.patt [concrete]
  1256. // CHECK:STDOUT: }
  1257. // CHECK:STDOUT: %a.var: ref %array_type.fe4 = var %a.var_patt
  1258. // CHECK:STDOUT: %.loc11_26.1: %empty_struct_type = struct_literal ()
  1259. // CHECK:STDOUT: %.loc11_30.1: %empty_struct_type = struct_literal ()
  1260. // CHECK:STDOUT: %.loc11_34.1: %empty_struct_type = struct_literal ()
  1261. // CHECK:STDOUT: %.loc11_35.1: %tuple.type = tuple_literal (%.loc11_26.1, %.loc11_30.1, %.loc11_34.1)
  1262. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  1263. // CHECK:STDOUT: %.loc11_35.2: ref %D = array_index %a.var, %int_0
  1264. // CHECK:STDOUT: %.loc11_26.2: init %D = class_init (), %.loc11_35.2 [concrete = constants.%D.val]
  1265. // CHECK:STDOUT: %.loc11_35.3: init %D = converted %.loc11_26.1, %.loc11_26.2 [concrete = constants.%D.val]
  1266. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1267. // CHECK:STDOUT: %.loc11_35.4: ref %D = array_index %a.var, %int_1
  1268. // CHECK:STDOUT: %.loc11_30.2: init %D = class_init (), %.loc11_35.4 [concrete = constants.%D.val]
  1269. // CHECK:STDOUT: %.loc11_35.5: init %D = converted %.loc11_30.1, %.loc11_30.2 [concrete = constants.%D.val]
  1270. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  1271. // CHECK:STDOUT: %.loc11_35.6: ref %D = array_index %a.var, %int_2
  1272. // CHECK:STDOUT: %.loc11_34.2: init %D = class_init (), %.loc11_35.6 [concrete = constants.%D.val]
  1273. // CHECK:STDOUT: %.loc11_35.7: init %D = converted %.loc11_34.1, %.loc11_34.2 [concrete = constants.%D.val]
  1274. // 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]
  1275. // CHECK:STDOUT: %.loc11_3: init %array_type.fe4 = converted %.loc11_35.1, %.loc11_35.8 [concrete = constants.%array]
  1276. // CHECK:STDOUT: assign %a.var, %.loc11_3
  1277. // CHECK:STDOUT: %.loc11_20: type = splice_block %array_type [concrete = constants.%array_type.fe4] {
  1278. // CHECK:STDOUT: %D.ref: type = name_ref D, file.%D.decl [concrete = constants.%D]
  1279. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  1280. // CHECK:STDOUT: %array_type: type = array_type %int_3, %D.ref [concrete = constants.%array_type.fe4]
  1281. // CHECK:STDOUT: }
  1282. // CHECK:STDOUT: %a: ref %array_type.fe4 = bind_name a, %a.var
  1283. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  1284. // CHECK:STDOUT: %a.ref: ref %array_type.fe4 = name_ref a, %a
  1285. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_3.1ba) [concrete = constants.%F.specific_fn]
  1286. // CHECK:STDOUT: %.loc22_12: %array_type.002 = converted %a.ref, <error> [concrete = <error>]
  1287. // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(<error>)
  1288. // CHECK:STDOUT: %.loc22_14.1: %i32 = value_of_initializer %F.call
  1289. // CHECK:STDOUT: %.loc22_14.2: %i32 = converted %F.call, %.loc22_14.1
  1290. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.11a
  1291. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.11a, @T.as.Destroy.impl.Op(constants.%array_type.fe4) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  1292. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn
  1293. // CHECK:STDOUT: %addr: %ptr.af6 = addr_of %a.var
  1294. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  1295. // CHECK:STDOUT: return %.loc22_14.2
  1296. // CHECK:STDOUT: }
  1297. // CHECK:STDOUT:
  1298. // CHECK:STDOUT: specific @F(constants.%N) {
  1299. // CHECK:STDOUT: %N.loc7_6.1 => constants.%N
  1300. // CHECK:STDOUT: %array_type.loc7_42.1 => constants.%array_type.6a2
  1301. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.9ee
  1302. // CHECK:STDOUT: }
  1303. // CHECK:STDOUT:
  1304. // CHECK:STDOUT: specific @F(constants.%int_3.1ba) {
  1305. // CHECK:STDOUT: %N.loc7_6.1 => constants.%int_3.1ba
  1306. // CHECK:STDOUT: %array_type.loc7_42.1 => constants.%array_type.002
  1307. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.a63
  1308. // CHECK:STDOUT:
  1309. // CHECK:STDOUT: !definition:
  1310. // CHECK:STDOUT: %require_complete => constants.%complete_type.dd1
  1311. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound => constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b30
  1312. // CHECK:STDOUT: %bound_method.loc7_62.3 => constants.%bound_method.047
  1313. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc7_62.2 => constants.%int_3.822
  1314. // CHECK:STDOUT: }
  1315. // CHECK:STDOUT:
  1316. // CHECK:STDOUT: --- fail_bound_type_mismatch.carbon
  1317. // CHECK:STDOUT:
  1318. // CHECK:STDOUT: constants {
  1319. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  1320. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  1321. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
  1322. // CHECK:STDOUT: %Destroy.impl_witness.edd: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
  1323. // CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
  1324. // CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
  1325. // CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
  1326. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  1327. // CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
  1328. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1329. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  1330. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1331. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1332. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1333. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1334. // CHECK:STDOUT: %N.51e: %i32 = bind_symbolic_name N, 0 [symbolic]
  1335. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  1336. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  1337. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  1338. // CHECK:STDOUT: %ImplicitAs.type.2fd: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  1339. // CHECK:STDOUT: %ImplicitAs.Convert.type.71e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
  1340. // CHECK:STDOUT: %From: Core.IntLiteral = bind_symbolic_name From, 0 [symbolic]
  1341. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.708: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%From) [symbolic]
  1342. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.c68: %Int.as.ImplicitAs.impl.Convert.type.708 = struct_value () [symbolic]
  1343. // CHECK:STDOUT: %ImplicitAs.impl_witness.a11: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.1d9, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  1344. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.type.4ad: type = fn_type @Int.as.ImplicitAs.impl.Convert, @Int.as.ImplicitAs.impl(%int_32) [concrete]
  1345. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.960: %Int.as.ImplicitAs.impl.Convert.type.4ad = struct_value () [concrete]
  1346. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.2fd = facet_value %i32, (%ImplicitAs.impl_witness.a11) [concrete]
  1347. // CHECK:STDOUT: %.0ea: type = fn_type_with_self_type %ImplicitAs.Convert.type.71e, %ImplicitAs.facet [concrete]
  1348. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.51e, %Int.as.ImplicitAs.impl.Convert.960 [symbolic]
  1349. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Int.as.ImplicitAs.impl.Convert.960, @Int.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  1350. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %N.51e, %Int.as.ImplicitAs.impl.Convert.specific_fn [symbolic]
  1351. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method(%N.51e) [symbolic]
  1352. // CHECK:STDOUT: %array_type.b2f: type = array_type %Int.as.ImplicitAs.impl.Convert.call, %C [symbolic]
  1353. // CHECK:STDOUT: %pattern_type.ac2: type = pattern_type %array_type.b2f [symbolic]
  1354. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1355. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1356. // CHECK:STDOUT: %require_complete.cde: <witness> = require_complete_type %array_type.b2f [symbolic]
  1357. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  1358. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  1359. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  1360. // CHECK:STDOUT: %array_type.002: type = array_type %int_3, %C [concrete]
  1361. // CHECK:STDOUT: %ptr.301: type = ptr_type %array_type.002 [concrete]
  1362. // CHECK:STDOUT: %pattern_type.a63: type = pattern_type %array_type.002 [concrete]
  1363. // CHECK:STDOUT: %tuple.type: type = tuple_type (%empty_struct_type, %empty_struct_type, %empty_struct_type) [concrete]
  1364. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  1365. // CHECK:STDOUT: %C.val: %C = struct_value () [concrete]
  1366. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  1367. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
  1368. // CHECK:STDOUT: %array: %array_type.002 = tuple_value (%C.val, %C.val, %C.val) [concrete]
  1369. // CHECK:STDOUT: %T.as.Destroy.impl.Op.type.85d: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%array_type.002) [concrete]
  1370. // CHECK:STDOUT: %T.as.Destroy.impl.Op.1f9: %T.as.Destroy.impl.Op.type.85d = struct_value () [concrete]
  1371. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function %T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(%array_type.002) [concrete]
  1372. // CHECK:STDOUT: }
  1373. // CHECK:STDOUT:
  1374. // CHECK:STDOUT: imports {
  1375. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1376. // CHECK:STDOUT: .Destroy = %Core.Destroy
  1377. // CHECK:STDOUT: .Int = %Core.Int
  1378. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  1379. // CHECK:STDOUT: import Core//prelude
  1380. // CHECK:STDOUT: import Core//prelude/...
  1381. // CHECK:STDOUT: }
  1382. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  1383. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1384. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  1385. // CHECK:STDOUT: %Core.import_ref.85c: @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert.type (%Int.as.ImplicitAs.impl.Convert.type.708) = import_ref Core//prelude/parts/int, loc20_44, loaded [symbolic = @Int.as.ImplicitAs.impl.%Int.as.ImplicitAs.impl.Convert (constants.%Int.as.ImplicitAs.impl.Convert.c68)]
  1386. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.1d9 = impl_witness_table (%Core.import_ref.85c), @Int.as.ImplicitAs.impl [concrete]
  1387. // CHECK:STDOUT: }
  1388. // CHECK:STDOUT:
  1389. // CHECK:STDOUT: file {
  1390. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1391. // CHECK:STDOUT: .Core = imports.%Core
  1392. // CHECK:STDOUT: .C = %C.decl
  1393. // CHECK:STDOUT: .F = %F.decl
  1394. // CHECK:STDOUT: .G = %G.decl
  1395. // CHECK:STDOUT: }
  1396. // CHECK:STDOUT: %Core.import = import Core
  1397. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  1398. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
  1399. // CHECK:STDOUT: %N.patt: %pattern_type.7ce = symbolic_binding_pattern N, 0 [concrete]
  1400. // CHECK:STDOUT: %a.patt: @F.%pattern_type (%pattern_type.ac2) = binding_pattern a [concrete]
  1401. // CHECK:STDOUT: %a.param_patt: @F.%pattern_type (%pattern_type.ac2) = value_param_pattern %a.patt, call_param0 [concrete]
  1402. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1403. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
  1404. // CHECK:STDOUT: } {
  1405. // CHECK:STDOUT: %int_32.loc6_34: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1406. // CHECK:STDOUT: %i32.loc6_34: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1407. // CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [concrete = constants.%i32] {
  1408. // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1409. // CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1410. // CHECK:STDOUT: }
  1411. // CHECK:STDOUT: %N.loc6_6.2: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1412. // CHECK:STDOUT: %a.param: @F.%array_type.loc6_28.1 (%array_type.b2f) = value_param call_param0
  1413. // CHECK:STDOUT: %.loc6_28: type = splice_block %array_type.loc6_28.2 [symbolic = %array_type.loc6_28.1 (constants.%array_type.b2f)] {
  1414. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1415. // CHECK:STDOUT: %N.ref.loc6_27: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1416. // CHECK:STDOUT: %impl.elem0: %.0ea = impl_witness_access constants.%ImplicitAs.impl_witness.a11, element0 [concrete = constants.%Int.as.ImplicitAs.impl.Convert.960]
  1417. // CHECK:STDOUT: %bound_method.loc6_27.2: <bound method> = bound_method %N.ref.loc6_27, %impl.elem0 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)]
  1418. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Int.as.ImplicitAs.impl.Convert.specific_fn]
  1419. // CHECK:STDOUT: %bound_method.loc6_27.3: <bound method> = bound_method %N.ref.loc6_27, %specific_fn [symbolic = %bound_method.loc6_27.1 (constants.%bound_method)]
  1420. // 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)]
  1421. // 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)]
  1422. // 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)]
  1423. // CHECK:STDOUT: %array_type.loc6_28.2: type = array_type %.loc6_27.2, %C.ref [symbolic = %array_type.loc6_28.1 (constants.%array_type.b2f)]
  1424. // CHECK:STDOUT: }
  1425. // CHECK:STDOUT: %a: @F.%array_type.loc6_28.1 (%array_type.b2f) = bind_name a, %a.param
  1426. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
  1427. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1428. // CHECK:STDOUT: }
  1429. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
  1430. // CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
  1431. // CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
  1432. // CHECK:STDOUT: } {
  1433. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  1434. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  1435. // CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
  1436. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  1437. // CHECK:STDOUT: }
  1438. // CHECK:STDOUT: }
  1439. // CHECK:STDOUT:
  1440. // CHECK:STDOUT: impl @C.as.Destroy.impl: constants.%C as constants.%Destroy.type {
  1441. // CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
  1442. // CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
  1443. // CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
  1444. // CHECK:STDOUT: %.loc4: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
  1445. // CHECK:STDOUT: } {
  1446. // CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
  1447. // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
  1448. // CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
  1449. // CHECK:STDOUT: }
  1450. // CHECK:STDOUT:
  1451. // CHECK:STDOUT: !members:
  1452. // CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
  1453. // CHECK:STDOUT: witness = @C.%Destroy.impl_witness
  1454. // CHECK:STDOUT: }
  1455. // CHECK:STDOUT:
  1456. // CHECK:STDOUT: class @C {
  1457. // CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
  1458. // CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
  1459. // CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.edd]
  1460. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  1461. // CHECK:STDOUT: complete_type_witness = %complete_type
  1462. // CHECK:STDOUT:
  1463. // CHECK:STDOUT: !members:
  1464. // CHECK:STDOUT: .Self = constants.%C
  1465. // CHECK:STDOUT: }
  1466. // CHECK:STDOUT:
  1467. // CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
  1468. // CHECK:STDOUT:
  1469. // CHECK:STDOUT: generic fn @F(%N.loc6_6.2: %i32) {
  1470. // CHECK:STDOUT: %N.loc6_6.1: %i32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1471. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %N.loc6_6.1, constants.%Int.as.ImplicitAs.impl.Convert.960 [symbolic = %Int.as.ImplicitAs.impl.Convert.bound (constants.%Int.as.ImplicitAs.impl.Convert.bound)]
  1472. // 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)]
  1473. // 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)]
  1474. // 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.b2f)]
  1475. // CHECK:STDOUT: %pattern_type: type = pattern_type %array_type.loc6_28.1 [symbolic = %pattern_type (constants.%pattern_type.ac2)]
  1476. // CHECK:STDOUT:
  1477. // CHECK:STDOUT: !definition:
  1478. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %array_type.loc6_28.1 [symbolic = %require_complete (constants.%require_complete.cde)]
  1479. // CHECK:STDOUT:
  1480. // CHECK:STDOUT: fn(%a.param: @F.%array_type.loc6_28.1 (%array_type.b2f)) -> %i32 {
  1481. // CHECK:STDOUT: !entry:
  1482. // CHECK:STDOUT: %N.ref.loc6_47: %i32 = name_ref N, %N.loc6_6.2 [symbolic = %N.loc6_6.1 (constants.%N.51e)]
  1483. // CHECK:STDOUT: return %N.ref.loc6_47
  1484. // CHECK:STDOUT: }
  1485. // CHECK:STDOUT: }
  1486. // CHECK:STDOUT:
  1487. // CHECK:STDOUT: fn @G() -> %i32 {
  1488. // CHECK:STDOUT: !entry:
  1489. // CHECK:STDOUT: name_binding_decl {
  1490. // CHECK:STDOUT: %a.patt: %pattern_type.a63 = binding_pattern a [concrete]
  1491. // CHECK:STDOUT: %a.var_patt: %pattern_type.a63 = var_pattern %a.patt [concrete]
  1492. // CHECK:STDOUT: }
  1493. // CHECK:STDOUT: %a.var: ref %array_type.002 = var %a.var_patt
  1494. // CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal ()
  1495. // CHECK:STDOUT: %.loc9_30.1: %empty_struct_type = struct_literal ()
  1496. // CHECK:STDOUT: %.loc9_34.1: %empty_struct_type = struct_literal ()
  1497. // CHECK:STDOUT: %.loc9_35.1: %tuple.type = tuple_literal (%.loc9_26.1, %.loc9_30.1, %.loc9_34.1)
  1498. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  1499. // CHECK:STDOUT: %.loc9_35.2: ref %C = array_index %a.var, %int_0
  1500. // CHECK:STDOUT: %.loc9_26.2: init %C = class_init (), %.loc9_35.2 [concrete = constants.%C.val]
  1501. // CHECK:STDOUT: %.loc9_35.3: init %C = converted %.loc9_26.1, %.loc9_26.2 [concrete = constants.%C.val]
  1502. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1503. // CHECK:STDOUT: %.loc9_35.4: ref %C = array_index %a.var, %int_1
  1504. // CHECK:STDOUT: %.loc9_30.2: init %C = class_init (), %.loc9_35.4 [concrete = constants.%C.val]
  1505. // CHECK:STDOUT: %.loc9_35.5: init %C = converted %.loc9_30.1, %.loc9_30.2 [concrete = constants.%C.val]
  1506. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
  1507. // CHECK:STDOUT: %.loc9_35.6: ref %C = array_index %a.var, %int_2
  1508. // CHECK:STDOUT: %.loc9_34.2: init %C = class_init (), %.loc9_35.6 [concrete = constants.%C.val]
  1509. // CHECK:STDOUT: %.loc9_35.7: init %C = converted %.loc9_34.1, %.loc9_34.2 [concrete = constants.%C.val]
  1510. // 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]
  1511. // CHECK:STDOUT: %.loc9_3: init %array_type.002 = converted %.loc9_35.1, %.loc9_35.8 [concrete = constants.%array]
  1512. // CHECK:STDOUT: assign %a.var, %.loc9_3
  1513. // CHECK:STDOUT: %.loc9_20: type = splice_block %array_type [concrete = constants.%array_type.002] {
  1514. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  1515. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  1516. // CHECK:STDOUT: %array_type: type = array_type %int_3, %C.ref [concrete = constants.%array_type.002]
  1517. // CHECK:STDOUT: }
  1518. // CHECK:STDOUT: %a: ref %array_type.002 = bind_name a, %a.var
  1519. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
  1520. // CHECK:STDOUT: %a.ref: ref %array_type.002 = name_ref a, %a
  1521. // CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.1f9
  1522. // CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.1f9, @T.as.Destroy.impl.Op(constants.%array_type.002) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn]
  1523. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn
  1524. // CHECK:STDOUT: %addr: %ptr.301 = addr_of %a.var
  1525. // CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
  1526. // CHECK:STDOUT: return <error>
  1527. // CHECK:STDOUT: }
  1528. // CHECK:STDOUT:
  1529. // CHECK:STDOUT: specific @F(constants.%N.51e) {
  1530. // CHECK:STDOUT: %N.loc6_6.1 => constants.%N.51e
  1531. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.bound => constants.%Int.as.ImplicitAs.impl.Convert.bound
  1532. // CHECK:STDOUT: %bound_method.loc6_27.1 => constants.%bound_method
  1533. // CHECK:STDOUT: %Int.as.ImplicitAs.impl.Convert.call.loc6_27.1 => constants.%Int.as.ImplicitAs.impl.Convert.call
  1534. // CHECK:STDOUT: %array_type.loc6_28.1 => constants.%array_type.b2f
  1535. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ac2
  1536. // CHECK:STDOUT: }
  1537. // CHECK:STDOUT: