array.carbon 120 KB

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