call_from_operator.carbon 93 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123
  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/none.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/function/builtin/call_from_operator.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/call_from_operator.carbon
  14. // --- core.carbon
  15. package Core;
  16. fn IntLiteral() -> type = "int_literal.make_type";
  17. fn Int(N: IntLiteral()) -> type = "int.make_type_signed";
  18. interface AddWith(T:! type) {
  19. fn Op[self: Self](other: Self) -> Self;
  20. }
  21. interface As(T:! type) {
  22. fn Convert[self: Self]() -> T;
  23. }
  24. interface ImplicitAs(T:! type) {
  25. fn Convert[self: Self]() -> T;
  26. }
  27. impl i32 as AddWith(i32) {
  28. fn Op[self: Self](other: Self) -> Self = "int.sadd";
  29. }
  30. impl IntLiteral() as As(i32) {
  31. fn Convert[self: Self]() -> i32 = "int.convert_checked";
  32. }
  33. impl IntLiteral() as ImplicitAs(i32) {
  34. fn Convert[self: Self]() -> i32 = "int.convert_checked";
  35. }
  36. impl i32 as ImplicitAs(IntLiteral()) {
  37. fn Convert[self: Self]() -> IntLiteral() = "int.convert_checked";
  38. }
  39. // --- user.carbon
  40. import Core;
  41. var arr: array(i32, (1 as i32) + (2 as i32)) = (3, 4, (3 as i32) + (4 as i32));
  42. // CHECK:STDOUT: --- core.carbon
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: constants {
  45. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  46. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [concrete]
  47. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [concrete]
  48. // CHECK:STDOUT: %pattern_type.dc0: type = pattern_type Core.IntLiteral [concrete]
  49. // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
  50. // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
  51. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  52. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self]
  53. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  54. // CHECK:STDOUT: %AddWith.type.b35: type = generic_interface_type @AddWith [concrete]
  55. // CHECK:STDOUT: %AddWith.generic: %AddWith.type.b35 = struct_value () [concrete]
  56. // CHECK:STDOUT: %AddWith.type.483: type = facet_type <@AddWith, @AddWith(%T)> [symbolic]
  57. // CHECK:STDOUT: %Self.cc4: %AddWith.type.483 = bind_symbolic_name Self, 1 [symbolic]
  58. // CHECK:STDOUT: %Self.binding.as_type.9cc: type = symbolic_binding_type Self, 1, %Self.cc4 [symbolic]
  59. // CHECK:STDOUT: %pattern_type.496: type = pattern_type %Self.binding.as_type.9cc [symbolic]
  60. // CHECK:STDOUT: %AddWith.Op.type.5b7: type = fn_type @AddWith.Op, @AddWith(%T) [symbolic]
  61. // CHECK:STDOUT: %AddWith.Op.037: %AddWith.Op.type.5b7 = struct_value () [symbolic]
  62. // CHECK:STDOUT: %AddWith.assoc_type.36e: type = assoc_entity_type @AddWith, @AddWith(%T) [symbolic]
  63. // CHECK:STDOUT: %assoc0.adf: %AddWith.assoc_type.36e = assoc_entity element0, @AddWith.%AddWith.Op.decl [symbolic]
  64. // CHECK:STDOUT: %As.type.b51: type = generic_interface_type @As [concrete]
  65. // CHECK:STDOUT: %As.generic: %As.type.b51 = struct_value () [concrete]
  66. // CHECK:STDOUT: %As.type.69b: type = facet_type <@As, @As(%T)> [symbolic]
  67. // CHECK:STDOUT: %Self.c69: %As.type.69b = bind_symbolic_name Self, 1 [symbolic]
  68. // CHECK:STDOUT: %Self.binding.as_type.077: type = symbolic_binding_type Self, 1, %Self.c69 [symbolic]
  69. // CHECK:STDOUT: %pattern_type.fbf: type = pattern_type %Self.binding.as_type.077 [symbolic]
  70. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  71. // CHECK:STDOUT: %As.Convert.type.ad1: type = fn_type @As.Convert, @As(%T) [symbolic]
  72. // CHECK:STDOUT: %As.Convert.0ed: %As.Convert.type.ad1 = struct_value () [symbolic]
  73. // CHECK:STDOUT: %As.assoc_type.a21: type = assoc_entity_type @As, @As(%T) [symbolic]
  74. // CHECK:STDOUT: %assoc0.1d5: %As.assoc_type.a21 = assoc_entity element0, @As.%As.Convert.decl [symbolic]
  75. // CHECK:STDOUT: %ImplicitAs.type.96f: type = generic_interface_type @ImplicitAs [concrete]
  76. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.96f = struct_value () [concrete]
  77. // CHECK:STDOUT: %ImplicitAs.type.3ac: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic]
  78. // CHECK:STDOUT: %Self.6a1: %ImplicitAs.type.3ac = bind_symbolic_name Self, 1 [symbolic]
  79. // CHECK:STDOUT: %Self.binding.as_type.0ea: type = symbolic_binding_type Self, 1, %Self.6a1 [symbolic]
  80. // CHECK:STDOUT: %pattern_type.f6d: type = pattern_type %Self.binding.as_type.0ea [symbolic]
  81. // CHECK:STDOUT: %ImplicitAs.Convert.type.4cf: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%T) [symbolic]
  82. // CHECK:STDOUT: %ImplicitAs.Convert.147: %ImplicitAs.Convert.type.4cf = struct_value () [symbolic]
  83. // CHECK:STDOUT: %ImplicitAs.assoc_type.095: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%T) [symbolic]
  84. // CHECK:STDOUT: %assoc0.8f8: %ImplicitAs.assoc_type.095 = assoc_entity element0, @ImplicitAs.%ImplicitAs.Convert.decl [symbolic]
  85. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  86. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  87. // CHECK:STDOUT: %AddWith.type.f1c: type = facet_type <@AddWith, @AddWith(%i32.builtin)> [concrete]
  88. // CHECK:STDOUT: %Self.596: %AddWith.type.f1c = bind_symbolic_name Self, 1 [symbolic]
  89. // CHECK:STDOUT: %AddWith.Op.type.efc: type = fn_type @AddWith.Op, @AddWith(%i32.builtin) [concrete]
  90. // CHECK:STDOUT: %AddWith.Op.a62: %AddWith.Op.type.efc = struct_value () [concrete]
  91. // CHECK:STDOUT: %AddWith.assoc_type.a65: type = assoc_entity_type @AddWith, @AddWith(%i32.builtin) [concrete]
  92. // CHECK:STDOUT: %assoc0.ee2: %AddWith.assoc_type.a65 = assoc_entity element0, @AddWith.%AddWith.Op.decl [concrete]
  93. // CHECK:STDOUT: %AddWith.impl_witness: <witness> = impl_witness file.%AddWith.impl_witness_table [concrete]
  94. // CHECK:STDOUT: %pattern_type.956: type = pattern_type %i32.builtin [concrete]
  95. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op.type: type = fn_type @i32.builtin.as.AddWith.impl.Op [concrete]
  96. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op: %i32.builtin.as.AddWith.impl.Op.type = struct_value () [concrete]
  97. // CHECK:STDOUT: %AddWith.facet: %AddWith.type.f1c = facet_value %i32.builtin, (%AddWith.impl_witness) [concrete]
  98. // CHECK:STDOUT: %As.type.cf8: type = facet_type <@As, @As(%i32.builtin)> [concrete]
  99. // CHECK:STDOUT: %Self.2ed: %As.type.cf8 = bind_symbolic_name Self, 1 [symbolic]
  100. // CHECK:STDOUT: %As.Convert.type.c0d: type = fn_type @As.Convert, @As(%i32.builtin) [concrete]
  101. // CHECK:STDOUT: %As.Convert.713: %As.Convert.type.c0d = struct_value () [concrete]
  102. // CHECK:STDOUT: %As.assoc_type.b9b: type = assoc_entity_type @As, @As(%i32.builtin) [concrete]
  103. // CHECK:STDOUT: %assoc0.b02: %As.assoc_type.b9b = assoc_entity element0, @As.%As.Convert.decl [concrete]
  104. // CHECK:STDOUT: %As.impl_witness: <witness> = impl_witness file.%As.impl_witness_table [concrete]
  105. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type: type = fn_type @Core.IntLiteral.as.As.impl.Convert [concrete]
  106. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert: %Core.IntLiteral.as.As.impl.Convert.type = struct_value () [concrete]
  107. // CHECK:STDOUT: %As.facet: %As.type.cf8 = facet_value Core.IntLiteral, (%As.impl_witness) [concrete]
  108. // CHECK:STDOUT: %ImplicitAs.type.adc: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [concrete]
  109. // CHECK:STDOUT: %Self.789: %ImplicitAs.type.adc = bind_symbolic_name Self, 1 [symbolic]
  110. // CHECK:STDOUT: %ImplicitAs.Convert.type.752: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32.builtin) [concrete]
  111. // CHECK:STDOUT: %ImplicitAs.Convert.fcc: %ImplicitAs.Convert.type.752 = struct_value () [concrete]
  112. // CHECK:STDOUT: %ImplicitAs.assoc_type.1cf: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%i32.builtin) [concrete]
  113. // CHECK:STDOUT: %assoc0.3ce: %ImplicitAs.assoc_type.1cf = assoc_entity element0, @ImplicitAs.%ImplicitAs.Convert.decl [concrete]
  114. // CHECK:STDOUT: %ImplicitAs.impl_witness.a3a: <witness> = impl_witness file.%ImplicitAs.impl_witness_table.loc27 [concrete]
  115. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert [concrete]
  116. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]
  117. // CHECK:STDOUT: %ImplicitAs.facet.7c0: %ImplicitAs.type.adc = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.a3a) [concrete]
  118. // CHECK:STDOUT: %ImplicitAs.type.0d7: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  119. // CHECK:STDOUT: %Self.91e: %ImplicitAs.type.0d7 = bind_symbolic_name Self, 1 [symbolic]
  120. // CHECK:STDOUT: %ImplicitAs.Convert.type.60e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
  121. // CHECK:STDOUT: %ImplicitAs.Convert.c73: %ImplicitAs.Convert.type.60e = struct_value () [concrete]
  122. // CHECK:STDOUT: %ImplicitAs.assoc_type.014: type = assoc_entity_type @ImplicitAs, @ImplicitAs(Core.IntLiteral) [concrete]
  123. // CHECK:STDOUT: %assoc0.757: %ImplicitAs.assoc_type.014 = assoc_entity element0, @ImplicitAs.%ImplicitAs.Convert.decl [concrete]
  124. // CHECK:STDOUT: %ImplicitAs.impl_witness.942: <witness> = impl_witness file.%ImplicitAs.impl_witness_table.loc31 [concrete]
  125. // CHECK:STDOUT: %i32.builtin.as.ImplicitAs.impl.Convert.type: type = fn_type @i32.builtin.as.ImplicitAs.impl.Convert [concrete]
  126. // CHECK:STDOUT: %i32.builtin.as.ImplicitAs.impl.Convert: %i32.builtin.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]
  127. // CHECK:STDOUT: %ImplicitAs.facet.4f3: %ImplicitAs.type.0d7 = facet_value %i32.builtin, (%ImplicitAs.impl_witness.942) [concrete]
  128. // CHECK:STDOUT: }
  129. // CHECK:STDOUT:
  130. // CHECK:STDOUT: file {
  131. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  132. // CHECK:STDOUT: .IntLiteral = %IntLiteral.decl
  133. // CHECK:STDOUT: .Int = %Int.decl
  134. // CHECK:STDOUT: .AddWith = %AddWith.decl
  135. // CHECK:STDOUT: .As = %As.decl
  136. // CHECK:STDOUT: .ImplicitAs = %ImplicitAs.decl
  137. // CHECK:STDOUT: }
  138. // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [concrete = constants.%IntLiteral] {
  139. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern [concrete]
  140. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern %return.patt, call_param0 [concrete]
  141. // CHECK:STDOUT: } {
  142. // CHECK:STDOUT: %return.param: ref type = out_param call_param0
  143. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  144. // CHECK:STDOUT: }
  145. // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [concrete = constants.%Int] {
  146. // CHECK:STDOUT: %N.patt: %pattern_type.dc0 = binding_pattern N [concrete]
  147. // CHECK:STDOUT: %N.param_patt: %pattern_type.dc0 = value_param_pattern %N.patt, call_param0 [concrete]
  148. // CHECK:STDOUT: %return.patt: %pattern_type.98f = return_slot_pattern [concrete]
  149. // CHECK:STDOUT: %return.param_patt: %pattern_type.98f = out_param_pattern %return.patt, call_param1 [concrete]
  150. // CHECK:STDOUT: } {
  151. // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param call_param0
  152. // CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.3 [concrete = Core.IntLiteral] {
  153. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral]
  154. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  155. // CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  156. // CHECK:STDOUT: %.loc5_22.3: type = converted %IntLiteral.call, %.loc5_22.2 [concrete = Core.IntLiteral]
  157. // CHECK:STDOUT: }
  158. // CHECK:STDOUT: %N: Core.IntLiteral = bind_name N, %N.param
  159. // CHECK:STDOUT: %return.param: ref type = out_param call_param1
  160. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  161. // CHECK:STDOUT: }
  162. // CHECK:STDOUT: %AddWith.decl: %AddWith.type.b35 = interface_decl @AddWith [concrete = constants.%AddWith.generic] {
  163. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  164. // CHECK:STDOUT: } {
  165. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  166. // CHECK:STDOUT: %T.loc7_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_19.1 (constants.%T)]
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT: %As.decl: %As.type.b51 = interface_decl @As [concrete = constants.%As.generic] {
  169. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  170. // CHECK:STDOUT: } {
  171. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  172. // CHECK:STDOUT: %T.loc11_14.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.1 (constants.%T)]
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT: %ImplicitAs.decl: %ImplicitAs.type.96f = interface_decl @ImplicitAs [concrete = constants.%ImplicitAs.generic] {
  175. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  176. // CHECK:STDOUT: } {
  177. // CHECK:STDOUT: %.Self: %type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
  178. // CHECK:STDOUT: %T.loc15_22.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_22.1 (constants.%T)]
  179. // CHECK:STDOUT: }
  180. // CHECK:STDOUT: impl_decl @i32.builtin.as.AddWith.impl [concrete] {} {
  181. // CHECK:STDOUT: %int_32.loc19_6: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  182. // CHECK:STDOUT: %Int.call.loc19_6: init type = call constants.%Int(%int_32.loc19_6) [concrete = constants.%i32.builtin]
  183. // CHECK:STDOUT: %.loc19_6.1: type = value_of_initializer %Int.call.loc19_6 [concrete = constants.%i32.builtin]
  184. // CHECK:STDOUT: %.loc19_6.2: type = converted %Int.call.loc19_6, %.loc19_6.1 [concrete = constants.%i32.builtin]
  185. // CHECK:STDOUT: %AddWith.ref: %AddWith.type.b35 = name_ref AddWith, file.%AddWith.decl [concrete = constants.%AddWith.generic]
  186. // CHECK:STDOUT: %int_32.loc19_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  187. // CHECK:STDOUT: %Int.call.loc19_21: init type = call constants.%Int(%int_32.loc19_21) [concrete = constants.%i32.builtin]
  188. // CHECK:STDOUT: %.loc19_24.1: type = value_of_initializer %Int.call.loc19_21 [concrete = constants.%i32.builtin]
  189. // CHECK:STDOUT: %.loc19_24.2: type = converted %Int.call.loc19_21, %.loc19_24.1 [concrete = constants.%i32.builtin]
  190. // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(constants.%i32.builtin)> [concrete = constants.%AddWith.type.f1c]
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT: %AddWith.impl_witness_table = impl_witness_table (@i32.builtin.as.AddWith.impl.%i32.builtin.as.AddWith.impl.Op.decl), @i32.builtin.as.AddWith.impl [concrete]
  193. // CHECK:STDOUT: %AddWith.impl_witness: <witness> = impl_witness %AddWith.impl_witness_table [concrete = constants.%AddWith.impl_witness]
  194. // CHECK:STDOUT: impl_decl @Core.IntLiteral.as.As.impl [concrete] {} {
  195. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral]
  196. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  197. // CHECK:STDOUT: %.loc23_17.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  198. // CHECK:STDOUT: %.loc23_17.2: type = converted %IntLiteral.call, %.loc23_17.1 [concrete = Core.IntLiteral]
  199. // CHECK:STDOUT: %As.ref: %As.type.b51 = name_ref As, file.%As.decl [concrete = constants.%As.generic]
  200. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  201. // CHECK:STDOUT: %Int.call: init type = call constants.%Int(%int_32) [concrete = constants.%i32.builtin]
  202. // CHECK:STDOUT: %.loc23_28.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin]
  203. // CHECK:STDOUT: %.loc23_28.2: type = converted %Int.call, %.loc23_28.1 [concrete = constants.%i32.builtin]
  204. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(constants.%i32.builtin)> [concrete = constants.%As.type.cf8]
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (@Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.decl), @Core.IntLiteral.as.As.impl [concrete]
  207. // CHECK:STDOUT: %As.impl_witness: <witness> = impl_witness %As.impl_witness_table [concrete = constants.%As.impl_witness]
  208. // CHECK:STDOUT: impl_decl @Core.IntLiteral.as.ImplicitAs.impl [concrete] {} {
  209. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral]
  210. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  211. // CHECK:STDOUT: %.loc27_17.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  212. // CHECK:STDOUT: %.loc27_17.2: type = converted %IntLiteral.call, %.loc27_17.1 [concrete = Core.IntLiteral]
  213. // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.96f = name_ref ImplicitAs, file.%ImplicitAs.decl [concrete = constants.%ImplicitAs.generic]
  214. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  215. // CHECK:STDOUT: %Int.call: init type = call constants.%Int(%int_32) [concrete = constants.%i32.builtin]
  216. // CHECK:STDOUT: %.loc27_36.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin]
  217. // CHECK:STDOUT: %.loc27_36.2: type = converted %Int.call, %.loc27_36.1 [concrete = constants.%i32.builtin]
  218. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(constants.%i32.builtin)> [concrete = constants.%ImplicitAs.type.adc]
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc27 = impl_witness_table (@Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.decl), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  221. // CHECK:STDOUT: %ImplicitAs.impl_witness.loc27: <witness> = impl_witness %ImplicitAs.impl_witness_table.loc27 [concrete = constants.%ImplicitAs.impl_witness.a3a]
  222. // CHECK:STDOUT: impl_decl @i32.builtin.as.ImplicitAs.impl [concrete] {} {
  223. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  224. // CHECK:STDOUT: %Int.call: init type = call constants.%Int(%int_32) [concrete = constants.%i32.builtin]
  225. // CHECK:STDOUT: %.loc31_6.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin]
  226. // CHECK:STDOUT: %.loc31_6.2: type = converted %Int.call, %.loc31_6.1 [concrete = constants.%i32.builtin]
  227. // CHECK:STDOUT: %ImplicitAs.ref: %ImplicitAs.type.96f = name_ref ImplicitAs, file.%ImplicitAs.decl [concrete = constants.%ImplicitAs.generic]
  228. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral]
  229. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  230. // CHECK:STDOUT: %.loc31_36.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  231. // CHECK:STDOUT: %.loc31_36.2: type = converted %IntLiteral.call, %.loc31_36.1 [concrete = Core.IntLiteral]
  232. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete = constants.%ImplicitAs.type.0d7]
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.loc31 = impl_witness_table (@i32.builtin.as.ImplicitAs.impl.%i32.builtin.as.ImplicitAs.impl.Convert.decl), @i32.builtin.as.ImplicitAs.impl [concrete]
  235. // CHECK:STDOUT: %ImplicitAs.impl_witness.loc31: <witness> = impl_witness %ImplicitAs.impl_witness_table.loc31 [concrete = constants.%ImplicitAs.impl_witness.942]
  236. // CHECK:STDOUT: }
  237. // CHECK:STDOUT:
  238. // CHECK:STDOUT: generic interface @AddWith(%T.loc7_19.2: type) {
  239. // CHECK:STDOUT: %T.loc7_19.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_19.1 (constants.%T)]
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: !definition:
  242. // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(%T.loc7_19.1)> [symbolic = %AddWith.type (constants.%AddWith.type.483)]
  243. // CHECK:STDOUT: %Self.2: @AddWith.%AddWith.type (%AddWith.type.483) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.cc4)]
  244. // CHECK:STDOUT: %AddWith.Op.type: type = fn_type @AddWith.Op, @AddWith(%T.loc7_19.1) [symbolic = %AddWith.Op.type (constants.%AddWith.Op.type.5b7)]
  245. // CHECK:STDOUT: %AddWith.Op: @AddWith.%AddWith.Op.type (%AddWith.Op.type.5b7) = struct_value () [symbolic = %AddWith.Op (constants.%AddWith.Op.037)]
  246. // CHECK:STDOUT: %AddWith.assoc_type: type = assoc_entity_type @AddWith, @AddWith(%T.loc7_19.1) [symbolic = %AddWith.assoc_type (constants.%AddWith.assoc_type.36e)]
  247. // CHECK:STDOUT: %assoc0.loc8_41.2: @AddWith.%AddWith.assoc_type (%AddWith.assoc_type.36e) = assoc_entity element0, %AddWith.Op.decl [symbolic = %assoc0.loc8_41.2 (constants.%assoc0.adf)]
  248. // CHECK:STDOUT:
  249. // CHECK:STDOUT: interface {
  250. // CHECK:STDOUT: %Self.1: @AddWith.%AddWith.type (%AddWith.type.483) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.cc4)]
  251. // CHECK:STDOUT: %AddWith.Op.decl: @AddWith.%AddWith.Op.type (%AddWith.Op.type.5b7) = fn_decl @AddWith.Op [symbolic = @AddWith.%AddWith.Op (constants.%AddWith.Op.037)] {
  252. // CHECK:STDOUT: %self.patt: @AddWith.Op.%pattern_type (%pattern_type.496) = binding_pattern self [concrete]
  253. // CHECK:STDOUT: %self.param_patt: @AddWith.Op.%pattern_type (%pattern_type.496) = value_param_pattern %self.patt, call_param0 [concrete]
  254. // CHECK:STDOUT: %other.patt: @AddWith.Op.%pattern_type (%pattern_type.496) = binding_pattern other [concrete]
  255. // CHECK:STDOUT: %other.param_patt: @AddWith.Op.%pattern_type (%pattern_type.496) = value_param_pattern %other.patt, call_param1 [concrete]
  256. // CHECK:STDOUT: %return.patt: @AddWith.Op.%pattern_type (%pattern_type.496) = return_slot_pattern [concrete]
  257. // CHECK:STDOUT: %return.param_patt: @AddWith.Op.%pattern_type (%pattern_type.496) = out_param_pattern %return.patt, call_param2 [concrete]
  258. // CHECK:STDOUT: } {
  259. // CHECK:STDOUT: %.loc8_37.1: @AddWith.Op.%AddWith.type (%AddWith.type.483) = specific_constant @AddWith.%Self.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.cc4)]
  260. // CHECK:STDOUT: %Self.ref.loc8_37: @AddWith.Op.%AddWith.type (%AddWith.type.483) = name_ref Self, %.loc8_37.1 [symbolic = %Self (constants.%Self.cc4)]
  261. // CHECK:STDOUT: %Self.as_type.loc8_37: type = facet_access_type %Self.ref.loc8_37 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)]
  262. // CHECK:STDOUT: %.loc8_37.2: type = converted %Self.ref.loc8_37, %Self.as_type.loc8_37 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)]
  263. // CHECK:STDOUT: %self.param: @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc) = value_param call_param0
  264. // CHECK:STDOUT: %.loc8_15.1: type = splice_block %.loc8_15.3 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)] {
  265. // CHECK:STDOUT: %.loc8_15.2: @AddWith.Op.%AddWith.type (%AddWith.type.483) = specific_constant @AddWith.%Self.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.cc4)]
  266. // CHECK:STDOUT: %Self.ref.loc8_15: @AddWith.Op.%AddWith.type (%AddWith.type.483) = name_ref Self, %.loc8_15.2 [symbolic = %Self (constants.%Self.cc4)]
  267. // CHECK:STDOUT: %Self.as_type.loc8_15: type = facet_access_type %Self.ref.loc8_15 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)]
  268. // CHECK:STDOUT: %.loc8_15.3: type = converted %Self.ref.loc8_15, %Self.as_type.loc8_15 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)]
  269. // CHECK:STDOUT: }
  270. // CHECK:STDOUT: %self: @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc) = bind_name self, %self.param
  271. // CHECK:STDOUT: %other.param: @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc) = value_param call_param1
  272. // CHECK:STDOUT: %.loc8_28.1: type = splice_block %.loc8_28.3 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)] {
  273. // CHECK:STDOUT: %.loc8_28.2: @AddWith.Op.%AddWith.type (%AddWith.type.483) = specific_constant @AddWith.%Self.1, @AddWith(constants.%T) [symbolic = %Self (constants.%Self.cc4)]
  274. // CHECK:STDOUT: %Self.ref.loc8_28: @AddWith.Op.%AddWith.type (%AddWith.type.483) = name_ref Self, %.loc8_28.2 [symbolic = %Self (constants.%Self.cc4)]
  275. // CHECK:STDOUT: %Self.as_type.loc8_28: type = facet_access_type %Self.ref.loc8_28 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)]
  276. // CHECK:STDOUT: %.loc8_28.3: type = converted %Self.ref.loc8_28, %Self.as_type.loc8_28 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)]
  277. // CHECK:STDOUT: }
  278. // CHECK:STDOUT: %other: @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc) = bind_name other, %other.param
  279. // CHECK:STDOUT: %return.param: ref @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc) = out_param call_param2
  280. // CHECK:STDOUT: %return: ref @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc) = return_slot %return.param
  281. // CHECK:STDOUT: }
  282. // CHECK:STDOUT: %assoc0.loc8_41.1: @AddWith.%AddWith.assoc_type (%AddWith.assoc_type.36e) = assoc_entity element0, %AddWith.Op.decl [symbolic = %assoc0.loc8_41.2 (constants.%assoc0.adf)]
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: !members:
  285. // CHECK:STDOUT: .Self = %Self.1
  286. // CHECK:STDOUT: .Op = %assoc0.loc8_41.1
  287. // CHECK:STDOUT: witness = (%AddWith.Op.decl)
  288. // CHECK:STDOUT: }
  289. // CHECK:STDOUT: }
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: generic interface @As(%T.loc11_14.2: type) {
  292. // CHECK:STDOUT: %T.loc11_14.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc11_14.1 (constants.%T)]
  293. // CHECK:STDOUT:
  294. // CHECK:STDOUT: !definition:
  295. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T.loc11_14.1)> [symbolic = %As.type (constants.%As.type.69b)]
  296. // CHECK:STDOUT: %Self.2: @As.%As.type (%As.type.69b) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.c69)]
  297. // CHECK:STDOUT: %As.Convert.type: type = fn_type @As.Convert, @As(%T.loc11_14.1) [symbolic = %As.Convert.type (constants.%As.Convert.type.ad1)]
  298. // CHECK:STDOUT: %As.Convert: @As.%As.Convert.type (%As.Convert.type.ad1) = struct_value () [symbolic = %As.Convert (constants.%As.Convert.0ed)]
  299. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As, @As(%T.loc11_14.1) [symbolic = %As.assoc_type (constants.%As.assoc_type.a21)]
  300. // CHECK:STDOUT: %assoc0.loc12_32.2: @As.%As.assoc_type (%As.assoc_type.a21) = assoc_entity element0, %As.Convert.decl [symbolic = %assoc0.loc12_32.2 (constants.%assoc0.1d5)]
  301. // CHECK:STDOUT:
  302. // CHECK:STDOUT: interface {
  303. // CHECK:STDOUT: %Self.1: @As.%As.type (%As.type.69b) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.c69)]
  304. // CHECK:STDOUT: %As.Convert.decl: @As.%As.Convert.type (%As.Convert.type.ad1) = fn_decl @As.Convert [symbolic = @As.%As.Convert (constants.%As.Convert.0ed)] {
  305. // CHECK:STDOUT: %self.patt: @As.Convert.%pattern_type.loc12_14 (%pattern_type.fbf) = binding_pattern self [concrete]
  306. // CHECK:STDOUT: %self.param_patt: @As.Convert.%pattern_type.loc12_14 (%pattern_type.fbf) = value_param_pattern %self.patt, call_param0 [concrete]
  307. // CHECK:STDOUT: %return.patt: @As.Convert.%pattern_type.loc12_28 (%pattern_type.7dc) = return_slot_pattern [concrete]
  308. // CHECK:STDOUT: %return.param_patt: @As.Convert.%pattern_type.loc12_28 (%pattern_type.7dc) = out_param_pattern %return.patt, call_param1 [concrete]
  309. // CHECK:STDOUT: } {
  310. // CHECK:STDOUT: %T.ref: type = name_ref T, @As.%T.loc11_14.2 [symbolic = %T (constants.%T)]
  311. // CHECK:STDOUT: %self.param: @As.Convert.%Self.binding.as_type (%Self.binding.as_type.077) = value_param call_param0
  312. // CHECK:STDOUT: %.loc12_20.1: type = splice_block %.loc12_20.3 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.077)] {
  313. // CHECK:STDOUT: %.loc12_20.2: @As.Convert.%As.type (%As.type.69b) = specific_constant @As.%Self.1, @As(constants.%T) [symbolic = %Self (constants.%Self.c69)]
  314. // CHECK:STDOUT: %Self.ref: @As.Convert.%As.type (%As.type.69b) = name_ref Self, %.loc12_20.2 [symbolic = %Self (constants.%Self.c69)]
  315. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.077)]
  316. // CHECK:STDOUT: %.loc12_20.3: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.077)]
  317. // CHECK:STDOUT: }
  318. // CHECK:STDOUT: %self: @As.Convert.%Self.binding.as_type (%Self.binding.as_type.077) = bind_name self, %self.param
  319. // CHECK:STDOUT: %return.param: ref @As.Convert.%T (%T) = out_param call_param1
  320. // CHECK:STDOUT: %return: ref @As.Convert.%T (%T) = return_slot %return.param
  321. // CHECK:STDOUT: }
  322. // CHECK:STDOUT: %assoc0.loc12_32.1: @As.%As.assoc_type (%As.assoc_type.a21) = assoc_entity element0, %As.Convert.decl [symbolic = %assoc0.loc12_32.2 (constants.%assoc0.1d5)]
  323. // CHECK:STDOUT:
  324. // CHECK:STDOUT: !members:
  325. // CHECK:STDOUT: .Self = %Self.1
  326. // CHECK:STDOUT: .T = <poisoned>
  327. // CHECK:STDOUT: .Convert = %assoc0.loc12_32.1
  328. // CHECK:STDOUT: witness = (%As.Convert.decl)
  329. // CHECK:STDOUT: }
  330. // CHECK:STDOUT: }
  331. // CHECK:STDOUT:
  332. // CHECK:STDOUT: generic interface @ImplicitAs(%T.loc15_22.2: type) {
  333. // CHECK:STDOUT: %T.loc15_22.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc15_22.1 (constants.%T)]
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: !definition:
  336. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T.loc15_22.1)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3ac)]
  337. // CHECK:STDOUT: %Self.2: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3ac) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.6a1)]
  338. // CHECK:STDOUT: %ImplicitAs.Convert.type: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%T.loc15_22.1) [symbolic = %ImplicitAs.Convert.type (constants.%ImplicitAs.Convert.type.4cf)]
  339. // CHECK:STDOUT: %ImplicitAs.Convert: @ImplicitAs.%ImplicitAs.Convert.type (%ImplicitAs.Convert.type.4cf) = struct_value () [symbolic = %ImplicitAs.Convert (constants.%ImplicitAs.Convert.147)]
  340. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%T.loc15_22.1) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.095)]
  341. // CHECK:STDOUT: %assoc0.loc16_32.2: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.095) = assoc_entity element0, %ImplicitAs.Convert.decl [symbolic = %assoc0.loc16_32.2 (constants.%assoc0.8f8)]
  342. // CHECK:STDOUT:
  343. // CHECK:STDOUT: interface {
  344. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3ac) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.6a1)]
  345. // CHECK:STDOUT: %ImplicitAs.Convert.decl: @ImplicitAs.%ImplicitAs.Convert.type (%ImplicitAs.Convert.type.4cf) = fn_decl @ImplicitAs.Convert [symbolic = @ImplicitAs.%ImplicitAs.Convert (constants.%ImplicitAs.Convert.147)] {
  346. // CHECK:STDOUT: %self.patt: @ImplicitAs.Convert.%pattern_type.loc16_14 (%pattern_type.f6d) = binding_pattern self [concrete]
  347. // CHECK:STDOUT: %self.param_patt: @ImplicitAs.Convert.%pattern_type.loc16_14 (%pattern_type.f6d) = value_param_pattern %self.patt, call_param0 [concrete]
  348. // CHECK:STDOUT: %return.patt: @ImplicitAs.Convert.%pattern_type.loc16_28 (%pattern_type.7dc) = return_slot_pattern [concrete]
  349. // CHECK:STDOUT: %return.param_patt: @ImplicitAs.Convert.%pattern_type.loc16_28 (%pattern_type.7dc) = out_param_pattern %return.patt, call_param1 [concrete]
  350. // CHECK:STDOUT: } {
  351. // CHECK:STDOUT: %T.ref: type = name_ref T, @ImplicitAs.%T.loc15_22.2 [symbolic = %T (constants.%T)]
  352. // CHECK:STDOUT: %self.param: @ImplicitAs.Convert.%Self.binding.as_type (%Self.binding.as_type.0ea) = value_param call_param0
  353. // CHECK:STDOUT: %.loc16_20.1: type = splice_block %.loc16_20.3 [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.0ea)] {
  354. // CHECK:STDOUT: %.loc16_20.2: @ImplicitAs.Convert.%ImplicitAs.type (%ImplicitAs.type.3ac) = specific_constant @ImplicitAs.%Self.1, @ImplicitAs(constants.%T) [symbolic = %Self (constants.%Self.6a1)]
  355. // CHECK:STDOUT: %Self.ref: @ImplicitAs.Convert.%ImplicitAs.type (%ImplicitAs.type.3ac) = name_ref Self, %.loc16_20.2 [symbolic = %Self (constants.%Self.6a1)]
  356. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.ref [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.0ea)]
  357. // CHECK:STDOUT: %.loc16_20.3: type = converted %Self.ref, %Self.as_type [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.0ea)]
  358. // CHECK:STDOUT: }
  359. // CHECK:STDOUT: %self: @ImplicitAs.Convert.%Self.binding.as_type (%Self.binding.as_type.0ea) = bind_name self, %self.param
  360. // CHECK:STDOUT: %return.param: ref @ImplicitAs.Convert.%T (%T) = out_param call_param1
  361. // CHECK:STDOUT: %return: ref @ImplicitAs.Convert.%T (%T) = return_slot %return.param
  362. // CHECK:STDOUT: }
  363. // CHECK:STDOUT: %assoc0.loc16_32.1: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.095) = assoc_entity element0, %ImplicitAs.Convert.decl [symbolic = %assoc0.loc16_32.2 (constants.%assoc0.8f8)]
  364. // CHECK:STDOUT:
  365. // CHECK:STDOUT: !members:
  366. // CHECK:STDOUT: .Self = %Self.1
  367. // CHECK:STDOUT: .T = <poisoned>
  368. // CHECK:STDOUT: .Convert = %assoc0.loc16_32.1
  369. // CHECK:STDOUT: witness = (%ImplicitAs.Convert.decl)
  370. // CHECK:STDOUT: }
  371. // CHECK:STDOUT: }
  372. // CHECK:STDOUT:
  373. // CHECK:STDOUT: impl @i32.builtin.as.AddWith.impl: %.loc19_6.2 as %AddWith.type {
  374. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op.decl: %i32.builtin.as.AddWith.impl.Op.type = fn_decl @i32.builtin.as.AddWith.impl.Op [concrete = constants.%i32.builtin.as.AddWith.impl.Op] {
  375. // CHECK:STDOUT: %self.patt: %pattern_type.956 = binding_pattern self [concrete]
  376. // CHECK:STDOUT: %self.param_patt: %pattern_type.956 = value_param_pattern %self.patt, call_param0 [concrete]
  377. // CHECK:STDOUT: %other.patt: %pattern_type.956 = binding_pattern other [concrete]
  378. // CHECK:STDOUT: %other.param_patt: %pattern_type.956 = value_param_pattern %other.patt, call_param1 [concrete]
  379. // CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern [concrete]
  380. // CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern %return.patt, call_param2 [concrete]
  381. // CHECK:STDOUT: } {
  382. // CHECK:STDOUT: %Self.ref.loc20_37: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc19_6.2 [concrete = constants.%i32.builtin]
  383. // CHECK:STDOUT: %self.param: %i32.builtin = value_param call_param0
  384. // CHECK:STDOUT: %Self.ref.loc20_15: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc19_6.2 [concrete = constants.%i32.builtin]
  385. // CHECK:STDOUT: %self: %i32.builtin = bind_name self, %self.param
  386. // CHECK:STDOUT: %other.param: %i32.builtin = value_param call_param1
  387. // CHECK:STDOUT: %Self.ref.loc20_28: type = name_ref Self, @i32.builtin.as.AddWith.impl.%.loc19_6.2 [concrete = constants.%i32.builtin]
  388. // CHECK:STDOUT: %other: %i32.builtin = bind_name other, %other.param
  389. // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param2
  390. // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT:
  393. // CHECK:STDOUT: !members:
  394. // CHECK:STDOUT: .Op = %i32.builtin.as.AddWith.impl.Op.decl
  395. // CHECK:STDOUT: witness = file.%AddWith.impl_witness
  396. // CHECK:STDOUT: }
  397. // CHECK:STDOUT:
  398. // CHECK:STDOUT: impl @Core.IntLiteral.as.As.impl: %.loc23_17.2 as %As.type {
  399. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.decl: %Core.IntLiteral.as.As.impl.Convert.type = fn_decl @Core.IntLiteral.as.As.impl.Convert [concrete = constants.%Core.IntLiteral.as.As.impl.Convert] {
  400. // CHECK:STDOUT: %self.patt: %pattern_type.dc0 = binding_pattern self [concrete]
  401. // CHECK:STDOUT: %self.param_patt: %pattern_type.dc0 = value_param_pattern %self.patt, call_param0 [concrete]
  402. // CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern [concrete]
  403. // CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern %return.patt, call_param1 [concrete]
  404. // CHECK:STDOUT: } {
  405. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  406. // CHECK:STDOUT: %Int.call: init type = call constants.%Int(%int_32) [concrete = constants.%i32.builtin]
  407. // CHECK:STDOUT: %.loc24_31.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin]
  408. // CHECK:STDOUT: %.loc24_31.2: type = converted %Int.call, %.loc24_31.1 [concrete = constants.%i32.builtin]
  409. // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param call_param0
  410. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @Core.IntLiteral.as.As.impl.%.loc23_17.2 [concrete = Core.IntLiteral]
  411. // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param
  412. // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param1
  413. // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: !members:
  417. // CHECK:STDOUT: .Convert = %Core.IntLiteral.as.As.impl.Convert.decl
  418. // CHECK:STDOUT: witness = file.%As.impl_witness
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT:
  421. // CHECK:STDOUT: impl @Core.IntLiteral.as.ImplicitAs.impl: %.loc27_17.2 as %ImplicitAs.type {
  422. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.decl: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type = fn_decl @Core.IntLiteral.as.ImplicitAs.impl.Convert [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert] {
  423. // CHECK:STDOUT: %self.patt: %pattern_type.dc0 = binding_pattern self [concrete]
  424. // CHECK:STDOUT: %self.param_patt: %pattern_type.dc0 = value_param_pattern %self.patt, call_param0 [concrete]
  425. // CHECK:STDOUT: %return.patt: %pattern_type.956 = return_slot_pattern [concrete]
  426. // CHECK:STDOUT: %return.param_patt: %pattern_type.956 = out_param_pattern %return.patt, call_param1 [concrete]
  427. // CHECK:STDOUT: } {
  428. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  429. // CHECK:STDOUT: %Int.call: init type = call constants.%Int(%int_32) [concrete = constants.%i32.builtin]
  430. // CHECK:STDOUT: %.loc28_31.1: type = value_of_initializer %Int.call [concrete = constants.%i32.builtin]
  431. // CHECK:STDOUT: %.loc28_31.2: type = converted %Int.call, %.loc28_31.1 [concrete = constants.%i32.builtin]
  432. // CHECK:STDOUT: %self.param: Core.IntLiteral = value_param call_param0
  433. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @Core.IntLiteral.as.ImplicitAs.impl.%.loc27_17.2 [concrete = Core.IntLiteral]
  434. // CHECK:STDOUT: %self: Core.IntLiteral = bind_name self, %self.param
  435. // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param call_param1
  436. // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param
  437. // CHECK:STDOUT: }
  438. // CHECK:STDOUT:
  439. // CHECK:STDOUT: !members:
  440. // CHECK:STDOUT: .Convert = %Core.IntLiteral.as.ImplicitAs.impl.Convert.decl
  441. // CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc27
  442. // CHECK:STDOUT: }
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: impl @i32.builtin.as.ImplicitAs.impl: %.loc31_6.2 as %ImplicitAs.type {
  445. // CHECK:STDOUT: %i32.builtin.as.ImplicitAs.impl.Convert.decl: %i32.builtin.as.ImplicitAs.impl.Convert.type = fn_decl @i32.builtin.as.ImplicitAs.impl.Convert [concrete = constants.%i32.builtin.as.ImplicitAs.impl.Convert] {
  446. // CHECK:STDOUT: %self.patt: %pattern_type.956 = binding_pattern self [concrete]
  447. // CHECK:STDOUT: %self.param_patt: %pattern_type.956 = value_param_pattern %self.patt, call_param0 [concrete]
  448. // CHECK:STDOUT: %return.patt: %pattern_type.dc0 = return_slot_pattern [concrete]
  449. // CHECK:STDOUT: %return.param_patt: %pattern_type.dc0 = out_param_pattern %return.patt, call_param1 [concrete]
  450. // CHECK:STDOUT: } {
  451. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [concrete = constants.%IntLiteral]
  452. // CHECK:STDOUT: %IntLiteral.call: init type = call %IntLiteral.ref() [concrete = Core.IntLiteral]
  453. // CHECK:STDOUT: %.loc32_42.1: type = value_of_initializer %IntLiteral.call [concrete = Core.IntLiteral]
  454. // CHECK:STDOUT: %.loc32_42.2: type = converted %IntLiteral.call, %.loc32_42.1 [concrete = Core.IntLiteral]
  455. // CHECK:STDOUT: %self.param: %i32.builtin = value_param call_param0
  456. // CHECK:STDOUT: %Self.ref: type = name_ref Self, @i32.builtin.as.ImplicitAs.impl.%.loc31_6.2 [concrete = constants.%i32.builtin]
  457. // CHECK:STDOUT: %self: %i32.builtin = bind_name self, %self.param
  458. // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param call_param1
  459. // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
  460. // CHECK:STDOUT: }
  461. // CHECK:STDOUT:
  462. // CHECK:STDOUT: !members:
  463. // CHECK:STDOUT: .IntLiteral = <poisoned>
  464. // CHECK:STDOUT: .Convert = %i32.builtin.as.ImplicitAs.impl.Convert.decl
  465. // CHECK:STDOUT: witness = file.%ImplicitAs.impl_witness.loc31
  466. // CHECK:STDOUT: }
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type";
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: fn @Int(%N.param: Core.IntLiteral) -> type = "int.make_type_signed";
  471. // CHECK:STDOUT:
  472. // CHECK:STDOUT: generic fn @AddWith.Op(@AddWith.%T.loc7_19.2: type, @AddWith.%Self.1: @AddWith.%AddWith.type (%AddWith.type.483)) {
  473. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  474. // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(%T)> [symbolic = %AddWith.type (constants.%AddWith.type.483)]
  475. // CHECK:STDOUT: %Self: @AddWith.Op.%AddWith.type (%AddWith.type.483) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.cc4)]
  476. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.9cc)]
  477. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.496)]
  478. // CHECK:STDOUT:
  479. // CHECK:STDOUT: fn(%self.param: @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc), %other.param: @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc)) -> @AddWith.Op.%Self.binding.as_type (%Self.binding.as_type.9cc);
  480. // CHECK:STDOUT: }
  481. // CHECK:STDOUT:
  482. // CHECK:STDOUT: generic fn @As.Convert(@As.%T.loc11_14.2: type, @As.%Self.1: @As.%As.type (%As.type.69b)) {
  483. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  484. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T)> [symbolic = %As.type (constants.%As.type.69b)]
  485. // CHECK:STDOUT: %Self: @As.Convert.%As.type (%As.type.69b) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.c69)]
  486. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.077)]
  487. // CHECK:STDOUT: %pattern_type.loc12_14: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc12_14 (constants.%pattern_type.fbf)]
  488. // CHECK:STDOUT: %pattern_type.loc12_28: type = pattern_type %T [symbolic = %pattern_type.loc12_28 (constants.%pattern_type.7dc)]
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: fn(%self.param: @As.Convert.%Self.binding.as_type (%Self.binding.as_type.077)) -> @As.Convert.%T (%T);
  491. // CHECK:STDOUT: }
  492. // CHECK:STDOUT:
  493. // CHECK:STDOUT: generic fn @ImplicitAs.Convert(@ImplicitAs.%T.loc15_22.2: type, @ImplicitAs.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.3ac)) {
  494. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  495. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3ac)]
  496. // CHECK:STDOUT: %Self: @ImplicitAs.Convert.%ImplicitAs.type (%ImplicitAs.type.3ac) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.6a1)]
  497. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.0ea)]
  498. // CHECK:STDOUT: %pattern_type.loc16_14: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.loc16_14 (constants.%pattern_type.f6d)]
  499. // CHECK:STDOUT: %pattern_type.loc16_28: type = pattern_type %T [symbolic = %pattern_type.loc16_28 (constants.%pattern_type.7dc)]
  500. // CHECK:STDOUT:
  501. // CHECK:STDOUT: fn(%self.param: @ImplicitAs.Convert.%Self.binding.as_type (%Self.binding.as_type.0ea)) -> @ImplicitAs.Convert.%T (%T);
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT:
  504. // CHECK:STDOUT: fn @i32.builtin.as.AddWith.impl.Op(%self.param: %i32.builtin, %other.param: %i32.builtin) -> %i32.builtin = "int.sadd";
  505. // CHECK:STDOUT:
  506. // CHECK:STDOUT: fn @Core.IntLiteral.as.As.impl.Convert(%self.param: Core.IntLiteral) -> %i32.builtin = "int.convert_checked";
  507. // CHECK:STDOUT:
  508. // CHECK:STDOUT: fn @Core.IntLiteral.as.ImplicitAs.impl.Convert(%self.param: Core.IntLiteral) -> %i32.builtin = "int.convert_checked";
  509. // CHECK:STDOUT:
  510. // CHECK:STDOUT: fn @i32.builtin.as.ImplicitAs.impl.Convert(%self.param: %i32.builtin) -> Core.IntLiteral = "int.convert_checked";
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: specific @AddWith(constants.%T) {
  513. // CHECK:STDOUT: %T.loc7_19.1 => constants.%T
  514. // CHECK:STDOUT: }
  515. // CHECK:STDOUT:
  516. // CHECK:STDOUT: specific @AddWith.Op(constants.%T, constants.%Self.cc4) {
  517. // CHECK:STDOUT: %T => constants.%T
  518. // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.483
  519. // CHECK:STDOUT: %Self => constants.%Self.cc4
  520. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.9cc
  521. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.496
  522. // CHECK:STDOUT: }
  523. // CHECK:STDOUT:
  524. // CHECK:STDOUT: specific @As(constants.%T) {
  525. // CHECK:STDOUT: %T.loc11_14.1 => constants.%T
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT:
  528. // CHECK:STDOUT: specific @As.Convert(constants.%T, constants.%Self.c69) {
  529. // CHECK:STDOUT: %T => constants.%T
  530. // CHECK:STDOUT: %As.type => constants.%As.type.69b
  531. // CHECK:STDOUT: %Self => constants.%Self.c69
  532. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.077
  533. // CHECK:STDOUT: %pattern_type.loc12_14 => constants.%pattern_type.fbf
  534. // CHECK:STDOUT: %pattern_type.loc12_28 => constants.%pattern_type.7dc
  535. // CHECK:STDOUT: }
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: specific @ImplicitAs(constants.%T) {
  538. // CHECK:STDOUT: %T.loc15_22.1 => constants.%T
  539. // CHECK:STDOUT: }
  540. // CHECK:STDOUT:
  541. // CHECK:STDOUT: specific @ImplicitAs.Convert(constants.%T, constants.%Self.6a1) {
  542. // CHECK:STDOUT: %T => constants.%T
  543. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3ac
  544. // CHECK:STDOUT: %Self => constants.%Self.6a1
  545. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.0ea
  546. // CHECK:STDOUT: %pattern_type.loc16_14 => constants.%pattern_type.f6d
  547. // CHECK:STDOUT: %pattern_type.loc16_28 => constants.%pattern_type.7dc
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT:
  550. // CHECK:STDOUT: specific @AddWith(constants.%i32.builtin) {
  551. // CHECK:STDOUT: %T.loc7_19.1 => constants.%i32.builtin
  552. // CHECK:STDOUT:
  553. // CHECK:STDOUT: !definition:
  554. // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.f1c
  555. // CHECK:STDOUT: %Self.2 => constants.%Self.596
  556. // CHECK:STDOUT: %AddWith.Op.type => constants.%AddWith.Op.type.efc
  557. // CHECK:STDOUT: %AddWith.Op => constants.%AddWith.Op.a62
  558. // CHECK:STDOUT: %AddWith.assoc_type => constants.%AddWith.assoc_type.a65
  559. // CHECK:STDOUT: %assoc0.loc8_41.2 => constants.%assoc0.ee2
  560. // CHECK:STDOUT: }
  561. // CHECK:STDOUT:
  562. // CHECK:STDOUT: specific @AddWith.Op(constants.%i32.builtin, constants.%AddWith.facet) {
  563. // CHECK:STDOUT: %T => constants.%i32.builtin
  564. // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.f1c
  565. // CHECK:STDOUT: %Self => constants.%AddWith.facet
  566. // CHECK:STDOUT: %Self.binding.as_type => constants.%i32.builtin
  567. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.956
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: specific @As(constants.%i32.builtin) {
  571. // CHECK:STDOUT: %T.loc11_14.1 => constants.%i32.builtin
  572. // CHECK:STDOUT:
  573. // CHECK:STDOUT: !definition:
  574. // CHECK:STDOUT: %As.type => constants.%As.type.cf8
  575. // CHECK:STDOUT: %Self.2 => constants.%Self.2ed
  576. // CHECK:STDOUT: %As.Convert.type => constants.%As.Convert.type.c0d
  577. // CHECK:STDOUT: %As.Convert => constants.%As.Convert.713
  578. // CHECK:STDOUT: %As.assoc_type => constants.%As.assoc_type.b9b
  579. // CHECK:STDOUT: %assoc0.loc12_32.2 => constants.%assoc0.b02
  580. // CHECK:STDOUT: }
  581. // CHECK:STDOUT:
  582. // CHECK:STDOUT: specific @As.Convert(constants.%i32.builtin, constants.%As.facet) {
  583. // CHECK:STDOUT: %T => constants.%i32.builtin
  584. // CHECK:STDOUT: %As.type => constants.%As.type.cf8
  585. // CHECK:STDOUT: %Self => constants.%As.facet
  586. // CHECK:STDOUT: %Self.binding.as_type => Core.IntLiteral
  587. // CHECK:STDOUT: %pattern_type.loc12_14 => constants.%pattern_type.dc0
  588. // CHECK:STDOUT: %pattern_type.loc12_28 => constants.%pattern_type.956
  589. // CHECK:STDOUT: }
  590. // CHECK:STDOUT:
  591. // CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) {
  592. // CHECK:STDOUT: %T.loc15_22.1 => constants.%i32.builtin
  593. // CHECK:STDOUT:
  594. // CHECK:STDOUT: !definition:
  595. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.adc
  596. // CHECK:STDOUT: %Self.2 => constants.%Self.789
  597. // CHECK:STDOUT: %ImplicitAs.Convert.type => constants.%ImplicitAs.Convert.type.752
  598. // CHECK:STDOUT: %ImplicitAs.Convert => constants.%ImplicitAs.Convert.fcc
  599. // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.1cf
  600. // CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.3ce
  601. // CHECK:STDOUT: }
  602. // CHECK:STDOUT:
  603. // CHECK:STDOUT: specific @ImplicitAs.Convert(constants.%i32.builtin, constants.%ImplicitAs.facet.7c0) {
  604. // CHECK:STDOUT: %T => constants.%i32.builtin
  605. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.adc
  606. // CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.7c0
  607. // CHECK:STDOUT: %Self.binding.as_type => Core.IntLiteral
  608. // CHECK:STDOUT: %pattern_type.loc16_14 => constants.%pattern_type.dc0
  609. // CHECK:STDOUT: %pattern_type.loc16_28 => constants.%pattern_type.956
  610. // CHECK:STDOUT: }
  611. // CHECK:STDOUT:
  612. // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
  613. // CHECK:STDOUT: %T.loc15_22.1 => Core.IntLiteral
  614. // CHECK:STDOUT:
  615. // CHECK:STDOUT: !definition:
  616. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.0d7
  617. // CHECK:STDOUT: %Self.2 => constants.%Self.91e
  618. // CHECK:STDOUT: %ImplicitAs.Convert.type => constants.%ImplicitAs.Convert.type.60e
  619. // CHECK:STDOUT: %ImplicitAs.Convert => constants.%ImplicitAs.Convert.c73
  620. // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.014
  621. // CHECK:STDOUT: %assoc0.loc16_32.2 => constants.%assoc0.757
  622. // CHECK:STDOUT: }
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: specific @ImplicitAs.Convert(Core.IntLiteral, constants.%ImplicitAs.facet.4f3) {
  625. // CHECK:STDOUT: %T => Core.IntLiteral
  626. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.0d7
  627. // CHECK:STDOUT: %Self => constants.%ImplicitAs.facet.4f3
  628. // CHECK:STDOUT: %Self.binding.as_type => constants.%i32.builtin
  629. // CHECK:STDOUT: %pattern_type.loc16_14 => constants.%pattern_type.956
  630. // CHECK:STDOUT: %pattern_type.loc16_28 => constants.%pattern_type.dc0
  631. // CHECK:STDOUT: }
  632. // CHECK:STDOUT:
  633. // CHECK:STDOUT: --- user.carbon
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: constants {
  636. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  637. // CHECK:STDOUT: %Int.type: type = fn_type @Int [concrete]
  638. // CHECK:STDOUT: %Int: %Int.type = struct_value () [concrete]
  639. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  640. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  641. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  642. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  643. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  644. // CHECK:STDOUT: %As.type.8d8: type = facet_type <@As, @As(%T)> [symbolic]
  645. // CHECK:STDOUT: %Self.4b9: %As.type.8d8 = bind_symbolic_name Self, 1 [symbolic]
  646. // CHECK:STDOUT: %As.Convert.type.843: type = fn_type @As.Convert, @As(%T) [symbolic]
  647. // CHECK:STDOUT: %As.Convert.95f: %As.Convert.type.843 = struct_value () [symbolic]
  648. // CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %T [symbolic]
  649. // CHECK:STDOUT: %Self.binding.as_type.40a: type = symbolic_binding_type Self, 1, %Self.4b9 [symbolic]
  650. // CHECK:STDOUT: %pattern_type.1b6: type = pattern_type %Self.binding.as_type.40a [symbolic]
  651. // CHECK:STDOUT: %As.assoc_type.760: type = assoc_entity_type @As, @As(%T) [symbolic]
  652. // CHECK:STDOUT: %assoc0.076: %As.assoc_type.760 = assoc_entity element0, imports.%Core.import_ref.708 [symbolic]
  653. // CHECK:STDOUT: %As.type.a29: type = facet_type <@As, @As(%i32.builtin)> [concrete]
  654. // CHECK:STDOUT: %Self.6b6: %As.type.a29 = bind_symbolic_name Self, 1 [symbolic]
  655. // CHECK:STDOUT: %As.Convert.type.378: type = fn_type @As.Convert, @As(%i32.builtin) [concrete]
  656. // CHECK:STDOUT: %As.Convert.e51: %As.Convert.type.378 = struct_value () [concrete]
  657. // CHECK:STDOUT: %As.assoc_type.bc2: type = assoc_entity_type @As, @As(%i32.builtin) [concrete]
  658. // CHECK:STDOUT: %assoc0.9fb: %As.assoc_type.bc2 = assoc_entity element0, imports.%Core.import_ref.708 [concrete]
  659. // CHECK:STDOUT: %assoc0.97d: %As.assoc_type.760 = assoc_entity element0, imports.%Core.import_ref.4e8 [symbolic]
  660. // CHECK:STDOUT: %As.impl_witness: <witness> = impl_witness imports.%As.impl_witness_table [concrete]
  661. // CHECK:STDOUT: %As.facet: %As.type.a29 = facet_value Core.IntLiteral, (%As.impl_witness) [concrete]
  662. // CHECK:STDOUT: %.8dd: type = fn_type_with_self_type %As.Convert.type.378, %As.facet [concrete]
  663. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type: type = fn_type @Core.IntLiteral.as.As.impl.Convert [concrete]
  664. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert: %Core.IntLiteral.as.As.impl.Convert.type = struct_value () [concrete]
  665. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.e07: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert [concrete]
  666. // CHECK:STDOUT: %int_1.f38: %i32.builtin = int_value 1 [concrete]
  667. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  668. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.5db: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.As.impl.Convert [concrete]
  669. // CHECK:STDOUT: %int_2.5a1: %i32.builtin = int_value 2 [concrete]
  670. // CHECK:STDOUT: %AddWith.type.e05: type = generic_interface_type @AddWith [concrete]
  671. // CHECK:STDOUT: %AddWith.generic: %AddWith.type.e05 = struct_value () [concrete]
  672. // CHECK:STDOUT: %AddWith.type.5d0: type = facet_type <@AddWith, @AddWith(%T)> [symbolic]
  673. // CHECK:STDOUT: %Self.25f: %AddWith.type.5d0 = bind_symbolic_name Self, 1 [symbolic]
  674. // CHECK:STDOUT: %AddWith.Op.type.22d: type = fn_type @AddWith.Op, @AddWith(%T) [symbolic]
  675. // CHECK:STDOUT: %AddWith.Op.965: %AddWith.Op.type.22d = struct_value () [symbolic]
  676. // CHECK:STDOUT: %Self.binding.as_type.ce3: type = symbolic_binding_type Self, 1, %Self.25f [symbolic]
  677. // CHECK:STDOUT: %pattern_type.378: type = pattern_type %Self.binding.as_type.ce3 [symbolic]
  678. // CHECK:STDOUT: %AddWith.assoc_type.c10: type = assoc_entity_type @AddWith, @AddWith(%T) [symbolic]
  679. // CHECK:STDOUT: %assoc0.6ec: %AddWith.assoc_type.c10 = assoc_entity element0, imports.%Core.import_ref.1b9 [symbolic]
  680. // CHECK:STDOUT: %AddWith.type.2a3: type = facet_type <@AddWith, @AddWith(%i32.builtin)> [concrete]
  681. // CHECK:STDOUT: %Self.b27: %AddWith.type.2a3 = bind_symbolic_name Self, 1 [symbolic]
  682. // CHECK:STDOUT: %AddWith.Op.type.0b7: type = fn_type @AddWith.Op, @AddWith(%i32.builtin) [concrete]
  683. // CHECK:STDOUT: %AddWith.Op.9d6: %AddWith.Op.type.0b7 = struct_value () [concrete]
  684. // CHECK:STDOUT: %AddWith.assoc_type.dff: type = assoc_entity_type @AddWith, @AddWith(%i32.builtin) [concrete]
  685. // CHECK:STDOUT: %assoc0.7f1: %AddWith.assoc_type.dff = assoc_entity element0, imports.%Core.import_ref.1b9 [concrete]
  686. // CHECK:STDOUT: %assoc0.899: %AddWith.assoc_type.c10 = assoc_entity element0, imports.%Core.import_ref.7e6 [symbolic]
  687. // CHECK:STDOUT: %AddWith.impl_witness: <witness> = impl_witness imports.%AddWith.impl_witness_table [concrete]
  688. // CHECK:STDOUT: %AddWith.facet: %AddWith.type.2a3 = facet_value %i32.builtin, (%AddWith.impl_witness) [concrete]
  689. // CHECK:STDOUT: %.f31: type = fn_type_with_self_type %AddWith.Op.type.0b7, %AddWith.facet [concrete]
  690. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op.type: type = fn_type @i32.builtin.as.AddWith.impl.Op [concrete]
  691. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op: %i32.builtin.as.AddWith.impl.Op.type = struct_value () [concrete]
  692. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op.bound.9a7: <bound method> = bound_method %int_1.f38, %i32.builtin.as.AddWith.impl.Op [concrete]
  693. // CHECK:STDOUT: %int_3.a0f: %i32.builtin = int_value 3 [concrete]
  694. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  695. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  696. // CHECK:STDOUT: %ImplicitAs.type.edb: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic]
  697. // CHECK:STDOUT: %Self.152: %ImplicitAs.type.edb = bind_symbolic_name Self, 1 [symbolic]
  698. // CHECK:STDOUT: %ImplicitAs.Convert.type.275: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%T) [symbolic]
  699. // CHECK:STDOUT: %ImplicitAs.Convert.42e: %ImplicitAs.Convert.type.275 = struct_value () [symbolic]
  700. // CHECK:STDOUT: %Self.binding.as_type.3b8: type = symbolic_binding_type Self, 1, %Self.152 [symbolic]
  701. // CHECK:STDOUT: %pattern_type.519: type = pattern_type %Self.binding.as_type.3b8 [symbolic]
  702. // CHECK:STDOUT: %ImplicitAs.assoc_type.ca0: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%T) [symbolic]
  703. // CHECK:STDOUT: %assoc0.9f5: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.1c752f.1 [symbolic]
  704. // CHECK:STDOUT: %ImplicitAs.type.7a9: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [concrete]
  705. // CHECK:STDOUT: %Self.d4e: %ImplicitAs.type.7a9 = bind_symbolic_name Self, 1 [symbolic]
  706. // CHECK:STDOUT: %ImplicitAs.Convert.type.71e: type = fn_type @ImplicitAs.Convert, @ImplicitAs(Core.IntLiteral) [concrete]
  707. // CHECK:STDOUT: %ImplicitAs.Convert.0e2: %ImplicitAs.Convert.type.71e = struct_value () [concrete]
  708. // CHECK:STDOUT: %ImplicitAs.assoc_type.959: type = assoc_entity_type @ImplicitAs, @ImplicitAs(Core.IntLiteral) [concrete]
  709. // CHECK:STDOUT: %assoc0.8c4: %ImplicitAs.assoc_type.959 = assoc_entity element0, imports.%Core.import_ref.1c752f.1 [concrete]
  710. // CHECK:STDOUT: %assoc0.dc0: %ImplicitAs.assoc_type.ca0 = assoc_entity element0, imports.%Core.import_ref.207 [symbolic]
  711. // CHECK:STDOUT: %ImplicitAs.type.873: type = facet_type <@ImplicitAs, @ImplicitAs(%i32.builtin)> [concrete]
  712. // CHECK:STDOUT: %Self.fef: %ImplicitAs.type.873 = bind_symbolic_name Self, 1 [symbolic]
  713. // CHECK:STDOUT: %ImplicitAs.Convert.type.059: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32.builtin) [concrete]
  714. // CHECK:STDOUT: %ImplicitAs.Convert.4d7: %ImplicitAs.Convert.type.059 = struct_value () [concrete]
  715. // CHECK:STDOUT: %ImplicitAs.assoc_type.398: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%i32.builtin) [concrete]
  716. // CHECK:STDOUT: %assoc0.6fd: %ImplicitAs.assoc_type.398 = assoc_entity element0, imports.%Core.import_ref.1c752f.2 [concrete]
  717. // CHECK:STDOUT: %ImplicitAs.impl_witness.fb8: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.16d [concrete]
  718. // CHECK:STDOUT: %ImplicitAs.facet.7e7: %ImplicitAs.type.7a9 = facet_value %i32.builtin, (%ImplicitAs.impl_witness.fb8) [concrete]
  719. // CHECK:STDOUT: %.f56: type = fn_type_with_self_type %ImplicitAs.Convert.type.71e, %ImplicitAs.facet.7e7 [concrete]
  720. // CHECK:STDOUT: %i32.builtin.as.ImplicitAs.impl.Convert.type: type = fn_type @i32.builtin.as.ImplicitAs.impl.Convert [concrete]
  721. // CHECK:STDOUT: %i32.builtin.as.ImplicitAs.impl.Convert: %i32.builtin.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]
  722. // CHECK:STDOUT: %i32.builtin.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_3.a0f, %i32.builtin.as.ImplicitAs.impl.Convert [concrete]
  723. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
  724. // CHECK:STDOUT: %array_type: type = array_type %int_3.1ba, %i32.builtin [concrete]
  725. // CHECK:STDOUT: %pattern_type.9e2: type = pattern_type %array_type [concrete]
  726. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete]
  727. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.55c: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.As.impl.Convert [concrete]
  728. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound.eb9: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.As.impl.Convert [concrete]
  729. // CHECK:STDOUT: %int_4.4f1: %i32.builtin = int_value 4 [concrete]
  730. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op.bound.81b: <bound method> = bound_method %int_3.a0f, %i32.builtin.as.AddWith.impl.Op [concrete]
  731. // CHECK:STDOUT: %int_7: %i32.builtin = int_value 7 [concrete]
  732. // CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral, %i32.builtin) [concrete]
  733. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
  734. // CHECK:STDOUT: %ImplicitAs.impl_witness.c15: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.b46 [concrete]
  735. // CHECK:STDOUT: %ImplicitAs.facet.2fc: %ImplicitAs.type.873 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c15) [concrete]
  736. // CHECK:STDOUT: %.63c: type = fn_type_with_self_type %ImplicitAs.Convert.type.059, %ImplicitAs.facet.2fc [concrete]
  737. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert [concrete]
  738. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type = struct_value () [concrete]
  739. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c88: <bound method> = bound_method %int_3.1ba, %Core.IntLiteral.as.ImplicitAs.impl.Convert [concrete]
  740. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6b7: <bound method> = bound_method %int_4.0c1, %Core.IntLiteral.as.ImplicitAs.impl.Convert [concrete]
  741. // CHECK:STDOUT: %array: %array_type = tuple_value (%int_3.a0f, %int_4.4f1, %int_7) [concrete]
  742. // CHECK:STDOUT: }
  743. // CHECK:STDOUT:
  744. // CHECK:STDOUT: imports {
  745. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  746. // CHECK:STDOUT: .Int = %Core.Int
  747. // CHECK:STDOUT: .As = %Core.As
  748. // CHECK:STDOUT: .AddWith = %Core.AddWith
  749. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  750. // CHECK:STDOUT: import Core//default
  751. // CHECK:STDOUT: }
  752. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//default, Int, loaded [concrete = constants.%Int]
  753. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//default, As, loaded [concrete = constants.%As.generic]
  754. // CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @As.%T (constants.%T)]
  755. // CHECK:STDOUT: %Core.import_ref.be8 = import_ref Core//default, inst{{[0-9A-F]+}} [no loc], unloaded
  756. // CHECK:STDOUT: %Core.import_ref.5e1: @As.%As.assoc_type (%As.assoc_type.760) = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @As.%assoc0 (constants.%assoc0.97d)]
  757. // CHECK:STDOUT: %Core.Convert.313 = import_ref Core//default, Convert, unloaded
  758. // CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @As.%T (constants.%T)]
  759. // CHECK:STDOUT: %Core.import_ref.a74: @As.%As.type (%As.type.8d8) = import_ref Core//default, inst{{[0-9A-F]+}} [no loc], loaded [symbolic = @As.%Self (constants.%Self.4b9)]
  760. // CHECK:STDOUT: %Core.import_ref.708: @As.%As.Convert.type (%As.Convert.type.843) = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @As.%As.Convert (constants.%As.Convert.95f)]
  761. // CHECK:STDOUT: %Core.import_ref.4e8 = import_ref Core//default, loc{{\d+_\d+}}, unloaded
  762. // CHECK:STDOUT: %Core.import_ref.931: <witness> = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%As.impl_witness]
  763. // CHECK:STDOUT: %Core.import_ref.8721d7.1: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = Core.IntLiteral]
  764. // CHECK:STDOUT: %Core.import_ref.a7f: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%As.type.a29]
  765. // CHECK:STDOUT: %Core.import_ref.a36: %Core.IntLiteral.as.As.impl.Convert.type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%Core.IntLiteral.as.As.impl.Convert]
  766. // CHECK:STDOUT: %As.impl_witness_table = impl_witness_table (%Core.import_ref.a36), @Core.IntLiteral.as.As.impl [concrete]
  767. // CHECK:STDOUT: %Core.AddWith: %AddWith.type.e05 = import_ref Core//default, AddWith, loaded [concrete = constants.%AddWith.generic]
  768. // CHECK:STDOUT: %Core.import_ref.5ab3ec.3: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @AddWith.%T (constants.%T)]
  769. // CHECK:STDOUT: %Core.import_ref.a58 = import_ref Core//default, inst{{[0-9A-F]+}} [no loc], unloaded
  770. // CHECK:STDOUT: %Core.import_ref.35d: @AddWith.%AddWith.assoc_type (%AddWith.assoc_type.c10) = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @AddWith.%assoc0 (constants.%assoc0.899)]
  771. // CHECK:STDOUT: %Core.Op = import_ref Core//default, Op, unloaded
  772. // CHECK:STDOUT: %Core.import_ref.5ab3ec.4: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @AddWith.%T (constants.%T)]
  773. // CHECK:STDOUT: %Core.import_ref.b29: @AddWith.%AddWith.type (%AddWith.type.5d0) = import_ref Core//default, inst{{[0-9A-F]+}} [no loc], loaded [symbolic = @AddWith.%Self (constants.%Self.25f)]
  774. // CHECK:STDOUT: %Core.import_ref.1b9: @AddWith.%AddWith.Op.type (%AddWith.Op.type.22d) = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @AddWith.%AddWith.Op (constants.%AddWith.Op.965)]
  775. // CHECK:STDOUT: %Core.import_ref.7e6 = import_ref Core//default, loc{{\d+_\d+}}, unloaded
  776. // CHECK:STDOUT: %Core.import_ref.8af: <witness> = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%AddWith.impl_witness]
  777. // CHECK:STDOUT: %Core.import_ref.c8c7cd.1: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%i32.builtin]
  778. // CHECK:STDOUT: %Core.import_ref.af3: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%AddWith.type.2a3]
  779. // CHECK:STDOUT: %Core.import_ref.980: %i32.builtin.as.AddWith.impl.Op.type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%i32.builtin.as.AddWith.impl.Op]
  780. // CHECK:STDOUT: %AddWith.impl_witness_table = impl_witness_table (%Core.import_ref.980), @i32.builtin.as.AddWith.impl [concrete]
  781. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//default, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  782. // CHECK:STDOUT: %Core.import_ref.5ab3ec.5: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.%T (constants.%T)]
  783. // CHECK:STDOUT: %Core.import_ref.e2c = import_ref Core//default, inst{{[0-9A-F]+}} [no loc], unloaded
  784. // CHECK:STDOUT: %Core.import_ref.492: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.dc0)]
  785. // CHECK:STDOUT: %Core.Convert.e69 = import_ref Core//default, Convert, unloaded
  786. // CHECK:STDOUT: %Core.import_ref.5ab3ec.6: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.%T (constants.%T)]
  787. // CHECK:STDOUT: %Core.import_ref.b95: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.edb) = import_ref Core//default, inst{{[0-9A-F]+}} [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.152)]
  788. // CHECK:STDOUT: %Core.import_ref.1c752f.1: @ImplicitAs.%ImplicitAs.Convert.type (%ImplicitAs.Convert.type.275) = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.%ImplicitAs.Convert (constants.%ImplicitAs.Convert.42e)]
  789. // CHECK:STDOUT: %Core.import_ref.207 = import_ref Core//default, loc{{\d+_\d+}}, unloaded
  790. // CHECK:STDOUT: %Core.import_ref.8a9: <witness> = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%ImplicitAs.impl_witness.c15]
  791. // CHECK:STDOUT: %Core.import_ref.8721d7.2: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = Core.IntLiteral]
  792. // CHECK:STDOUT: %Core.import_ref.64f: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%ImplicitAs.type.873]
  793. // CHECK:STDOUT: %Core.import_ref.1c752f.2: @ImplicitAs.%ImplicitAs.Convert.type (%ImplicitAs.Convert.type.275) = import_ref Core//default, loc{{\d+_\d+}}, loaded [symbolic = @ImplicitAs.%ImplicitAs.Convert (constants.%ImplicitAs.Convert.42e)]
  794. // CHECK:STDOUT: %Core.import_ref.614: <witness> = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%ImplicitAs.impl_witness.fb8]
  795. // CHECK:STDOUT: %Core.import_ref.c8c7cd.2: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%i32.builtin]
  796. // CHECK:STDOUT: %Core.import_ref.d7b: type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%ImplicitAs.type.7a9]
  797. // CHECK:STDOUT: %Core.import_ref.4ae: %i32.builtin.as.ImplicitAs.impl.Convert.type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%i32.builtin.as.ImplicitAs.impl.Convert]
  798. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.16d = impl_witness_table (%Core.import_ref.4ae), @i32.builtin.as.ImplicitAs.impl [concrete]
  799. // CHECK:STDOUT: %Core.import_ref.564: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type = import_ref Core//default, loc{{\d+_\d+}}, loaded [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert]
  800. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.b46 = impl_witness_table (%Core.import_ref.564), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  801. // CHECK:STDOUT: }
  802. // CHECK:STDOUT:
  803. // CHECK:STDOUT: file {
  804. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  805. // CHECK:STDOUT: .Core = imports.%Core
  806. // CHECK:STDOUT: .arr = %arr
  807. // CHECK:STDOUT: }
  808. // CHECK:STDOUT: %Core.import = import Core
  809. // CHECK:STDOUT: name_binding_decl {
  810. // CHECK:STDOUT: %arr.patt: %pattern_type.9e2 = binding_pattern arr [concrete]
  811. // CHECK:STDOUT: %arr.var_patt: %pattern_type.9e2 = var_pattern %arr.patt [concrete]
  812. // CHECK:STDOUT: }
  813. // CHECK:STDOUT: %arr.var: ref %array_type = var %arr.var_patt [concrete]
  814. // CHECK:STDOUT: %.loc4_44: type = splice_block %array_type [concrete = constants.%array_type] {
  815. // CHECK:STDOUT: %int_32.loc4_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  816. // CHECK:STDOUT: %Int.call.loc4_16: init type = call constants.%Int(%int_32.loc4_16) [concrete = constants.%i32.builtin]
  817. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  818. // CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  819. // CHECK:STDOUT: %Int.call.loc4_27: init type = call constants.%Int(%int_32.loc4_27) [concrete = constants.%i32.builtin]
  820. // CHECK:STDOUT: %.loc4_27.1: type = value_of_initializer %Int.call.loc4_27 [concrete = constants.%i32.builtin]
  821. // CHECK:STDOUT: %.loc4_27.2: type = converted %Int.call.loc4_27, %.loc4_27.1 [concrete = constants.%i32.builtin]
  822. // CHECK:STDOUT: %impl.elem0.loc4_24: %.8dd = impl_witness_access constants.%As.impl_witness, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert]
  823. // CHECK:STDOUT: %bound_method.loc4_24: <bound method> = bound_method %int_1, %impl.elem0.loc4_24 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.e07]
  824. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc4_24: init %i32.builtin = call %bound_method.loc4_24(%int_1) [concrete = constants.%int_1.f38]
  825. // CHECK:STDOUT: %.loc4_24.1: %i32.builtin = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc4_24 [concrete = constants.%int_1.f38]
  826. // CHECK:STDOUT: %.loc4_24.2: %i32.builtin = converted %int_1, %.loc4_24.1 [concrete = constants.%int_1.f38]
  827. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  828. // CHECK:STDOUT: %int_32.loc4_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  829. // CHECK:STDOUT: %Int.call.loc4_40: init type = call constants.%Int(%int_32.loc4_40) [concrete = constants.%i32.builtin]
  830. // CHECK:STDOUT: %.loc4_40.1: type = value_of_initializer %Int.call.loc4_40 [concrete = constants.%i32.builtin]
  831. // CHECK:STDOUT: %.loc4_40.2: type = converted %Int.call.loc4_40, %.loc4_40.1 [concrete = constants.%i32.builtin]
  832. // CHECK:STDOUT: %impl.elem0.loc4_37: %.8dd = impl_witness_access constants.%As.impl_witness, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert]
  833. // CHECK:STDOUT: %bound_method.loc4_37: <bound method> = bound_method %int_2, %impl.elem0.loc4_37 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.5db]
  834. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc4_37: init %i32.builtin = call %bound_method.loc4_37(%int_2) [concrete = constants.%int_2.5a1]
  835. // CHECK:STDOUT: %.loc4_37.1: %i32.builtin = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc4_37 [concrete = constants.%int_2.5a1]
  836. // CHECK:STDOUT: %.loc4_37.2: %i32.builtin = converted %int_2, %.loc4_37.1 [concrete = constants.%int_2.5a1]
  837. // CHECK:STDOUT: %impl.elem0.loc4_32.1: %.f31 = impl_witness_access constants.%AddWith.impl_witness, element0 [concrete = constants.%i32.builtin.as.AddWith.impl.Op]
  838. // CHECK:STDOUT: %bound_method.loc4_32.1: <bound method> = bound_method %.loc4_24.2, %impl.elem0.loc4_32.1 [concrete = constants.%i32.builtin.as.AddWith.impl.Op.bound.9a7]
  839. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op.call: init %i32.builtin = call %bound_method.loc4_32.1(%.loc4_24.2, %.loc4_37.2) [concrete = constants.%int_3.a0f]
  840. // CHECK:STDOUT: %.loc4_16.1: type = value_of_initializer %Int.call.loc4_16 [concrete = constants.%i32.builtin]
  841. // CHECK:STDOUT: %.loc4_16.2: type = converted %Int.call.loc4_16, %.loc4_16.1 [concrete = constants.%i32.builtin]
  842. // CHECK:STDOUT: %impl.elem0.loc4_32.2: %.f56 = impl_witness_access constants.%ImplicitAs.impl_witness.fb8, element0 [concrete = constants.%i32.builtin.as.ImplicitAs.impl.Convert]
  843. // CHECK:STDOUT: %bound_method.loc4_32.2: <bound method> = bound_method %i32.builtin.as.AddWith.impl.Op.call, %impl.elem0.loc4_32.2 [concrete = constants.%i32.builtin.as.ImplicitAs.impl.Convert.bound]
  844. // CHECK:STDOUT: %.loc4_32.1: %i32.builtin = value_of_initializer %i32.builtin.as.AddWith.impl.Op.call [concrete = constants.%int_3.a0f]
  845. // CHECK:STDOUT: %.loc4_32.2: %i32.builtin = converted %i32.builtin.as.AddWith.impl.Op.call, %.loc4_32.1 [concrete = constants.%int_3.a0f]
  846. // CHECK:STDOUT: %i32.builtin.as.ImplicitAs.impl.Convert.call: init Core.IntLiteral = call %bound_method.loc4_32.2(%.loc4_32.2) [concrete = constants.%int_3.1ba]
  847. // CHECK:STDOUT: %.loc4_32.3: Core.IntLiteral = value_of_initializer %i32.builtin.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.1ba]
  848. // CHECK:STDOUT: %.loc4_32.4: Core.IntLiteral = converted %i32.builtin.as.AddWith.impl.Op.call, %.loc4_32.3 [concrete = constants.%int_3.1ba]
  849. // CHECK:STDOUT: %array_type: type = array_type %.loc4_32.4, %.loc4_16.2 [concrete = constants.%array_type]
  850. // CHECK:STDOUT: }
  851. // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var [concrete = %arr.var]
  852. // CHECK:STDOUT: }
  853. // CHECK:STDOUT:
  854. // CHECK:STDOUT: generic interface @As(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] {
  855. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  856. // CHECK:STDOUT:
  857. // CHECK:STDOUT: !definition:
  858. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T)> [symbolic = %As.type (constants.%As.type.8d8)]
  859. // CHECK:STDOUT: %Self: @As.%As.type (%As.type.8d8) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4b9)]
  860. // CHECK:STDOUT: %As.Convert.type: type = fn_type @As.Convert, @As(%T) [symbolic = %As.Convert.type (constants.%As.Convert.type.843)]
  861. // CHECK:STDOUT: %As.Convert: @As.%As.Convert.type (%As.Convert.type.843) = struct_value () [symbolic = %As.Convert (constants.%As.Convert.95f)]
  862. // CHECK:STDOUT: %As.assoc_type: type = assoc_entity_type @As, @As(%T) [symbolic = %As.assoc_type (constants.%As.assoc_type.760)]
  863. // CHECK:STDOUT: %assoc0: @As.%As.assoc_type (%As.assoc_type.760) = assoc_entity element0, imports.%Core.import_ref.708 [symbolic = %assoc0 (constants.%assoc0.076)]
  864. // CHECK:STDOUT:
  865. // CHECK:STDOUT: interface {
  866. // CHECK:STDOUT: !members:
  867. // CHECK:STDOUT: .Self = imports.%Core.import_ref.be8
  868. // CHECK:STDOUT: .Convert = imports.%Core.import_ref.5e1
  869. // CHECK:STDOUT: witness = (imports.%Core.Convert.313)
  870. // CHECK:STDOUT: }
  871. // CHECK:STDOUT: }
  872. // CHECK:STDOUT:
  873. // CHECK:STDOUT: generic interface @AddWith(imports.%Core.import_ref.5ab3ec.3: type) [from "core.carbon"] {
  874. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  875. // CHECK:STDOUT:
  876. // CHECK:STDOUT: !definition:
  877. // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(%T)> [symbolic = %AddWith.type (constants.%AddWith.type.5d0)]
  878. // CHECK:STDOUT: %Self: @AddWith.%AddWith.type (%AddWith.type.5d0) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.25f)]
  879. // CHECK:STDOUT: %AddWith.Op.type: type = fn_type @AddWith.Op, @AddWith(%T) [symbolic = %AddWith.Op.type (constants.%AddWith.Op.type.22d)]
  880. // CHECK:STDOUT: %AddWith.Op: @AddWith.%AddWith.Op.type (%AddWith.Op.type.22d) = struct_value () [symbolic = %AddWith.Op (constants.%AddWith.Op.965)]
  881. // CHECK:STDOUT: %AddWith.assoc_type: type = assoc_entity_type @AddWith, @AddWith(%T) [symbolic = %AddWith.assoc_type (constants.%AddWith.assoc_type.c10)]
  882. // CHECK:STDOUT: %assoc0: @AddWith.%AddWith.assoc_type (%AddWith.assoc_type.c10) = assoc_entity element0, imports.%Core.import_ref.1b9 [symbolic = %assoc0 (constants.%assoc0.6ec)]
  883. // CHECK:STDOUT:
  884. // CHECK:STDOUT: interface {
  885. // CHECK:STDOUT: !members:
  886. // CHECK:STDOUT: .Self = imports.%Core.import_ref.a58
  887. // CHECK:STDOUT: .Op = imports.%Core.import_ref.35d
  888. // CHECK:STDOUT: witness = (imports.%Core.Op)
  889. // CHECK:STDOUT: }
  890. // CHECK:STDOUT: }
  891. // CHECK:STDOUT:
  892. // CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.5: type) [from "core.carbon"] {
  893. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  894. // CHECK:STDOUT:
  895. // CHECK:STDOUT: !definition:
  896. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.edb)]
  897. // CHECK:STDOUT: %Self: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.edb) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.152)]
  898. // CHECK:STDOUT: %ImplicitAs.Convert.type: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%T) [symbolic = %ImplicitAs.Convert.type (constants.%ImplicitAs.Convert.type.275)]
  899. // CHECK:STDOUT: %ImplicitAs.Convert: @ImplicitAs.%ImplicitAs.Convert.type (%ImplicitAs.Convert.type.275) = struct_value () [symbolic = %ImplicitAs.Convert (constants.%ImplicitAs.Convert.42e)]
  900. // CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs, @ImplicitAs(%T) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.ca0)]
  901. // CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.ca0) = assoc_entity element0, imports.%Core.import_ref.1c752f.1 [symbolic = %assoc0 (constants.%assoc0.9f5)]
  902. // CHECK:STDOUT:
  903. // CHECK:STDOUT: interface {
  904. // CHECK:STDOUT: !members:
  905. // CHECK:STDOUT: .Self = imports.%Core.import_ref.e2c
  906. // CHECK:STDOUT: .Convert = imports.%Core.import_ref.492
  907. // CHECK:STDOUT: witness = (imports.%Core.Convert.e69)
  908. // CHECK:STDOUT: }
  909. // CHECK:STDOUT: }
  910. // CHECK:STDOUT:
  911. // CHECK:STDOUT: impl @Core.IntLiteral.as.As.impl: imports.%Core.import_ref.8721d7.1 as imports.%Core.import_ref.a7f [from "core.carbon"] {
  912. // CHECK:STDOUT: !members:
  913. // CHECK:STDOUT: witness = imports.%Core.import_ref.931
  914. // CHECK:STDOUT: }
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: impl @i32.builtin.as.AddWith.impl: imports.%Core.import_ref.c8c7cd.1 as imports.%Core.import_ref.af3 [from "core.carbon"] {
  917. // CHECK:STDOUT: !members:
  918. // CHECK:STDOUT: witness = imports.%Core.import_ref.8af
  919. // CHECK:STDOUT: }
  920. // CHECK:STDOUT:
  921. // CHECK:STDOUT: impl @Core.IntLiteral.as.ImplicitAs.impl: imports.%Core.import_ref.8721d7.2 as imports.%Core.import_ref.64f [from "core.carbon"] {
  922. // CHECK:STDOUT: !members:
  923. // CHECK:STDOUT: witness = imports.%Core.import_ref.8a9
  924. // CHECK:STDOUT: }
  925. // CHECK:STDOUT:
  926. // CHECK:STDOUT: impl @i32.builtin.as.ImplicitAs.impl: imports.%Core.import_ref.c8c7cd.2 as imports.%Core.import_ref.d7b [from "core.carbon"] {
  927. // CHECK:STDOUT: !members:
  928. // CHECK:STDOUT: witness = imports.%Core.import_ref.614
  929. // CHECK:STDOUT: }
  930. // CHECK:STDOUT:
  931. // CHECK:STDOUT: fn @Int = "int.make_type_signed" [from "core.carbon"];
  932. // CHECK:STDOUT:
  933. // CHECK:STDOUT: generic fn @As.Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.a74: @As.%As.type (%As.type.8d8)) [from "core.carbon"] {
  934. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  935. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%T)> [symbolic = %As.type (constants.%As.type.8d8)]
  936. // CHECK:STDOUT: %Self: @As.Convert.%As.type (%As.type.8d8) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4b9)]
  937. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.40a)]
  938. // CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.1b6)]
  939. // CHECK:STDOUT: %pattern_type.2: type = pattern_type %T [symbolic = %pattern_type.2 (constants.%pattern_type.7dc)]
  940. // CHECK:STDOUT:
  941. // CHECK:STDOUT: fn;
  942. // CHECK:STDOUT: }
  943. // CHECK:STDOUT:
  944. // CHECK:STDOUT: fn @Core.IntLiteral.as.As.impl.Convert = "int.convert_checked" [from "core.carbon"];
  945. // CHECK:STDOUT:
  946. // CHECK:STDOUT: generic fn @AddWith.Op(imports.%Core.import_ref.5ab3ec.4: type, imports.%Core.import_ref.b29: @AddWith.%AddWith.type (%AddWith.type.5d0)) [from "core.carbon"] {
  947. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  948. // CHECK:STDOUT: %AddWith.type: type = facet_type <@AddWith, @AddWith(%T)> [symbolic = %AddWith.type (constants.%AddWith.type.5d0)]
  949. // CHECK:STDOUT: %Self: @AddWith.Op.%AddWith.type (%AddWith.type.5d0) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.25f)]
  950. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.ce3)]
  951. // CHECK:STDOUT: %pattern_type: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type (constants.%pattern_type.378)]
  952. // CHECK:STDOUT:
  953. // CHECK:STDOUT: fn;
  954. // CHECK:STDOUT: }
  955. // CHECK:STDOUT:
  956. // CHECK:STDOUT: fn @i32.builtin.as.AddWith.impl.Op = "int.sadd" [from "core.carbon"];
  957. // CHECK:STDOUT:
  958. // CHECK:STDOUT: generic fn @ImplicitAs.Convert(imports.%Core.import_ref.5ab3ec.6: type, imports.%Core.import_ref.b95: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.edb)) [from "core.carbon"] {
  959. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic = %T (constants.%T)]
  960. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%T)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.edb)]
  961. // CHECK:STDOUT: %Self: @ImplicitAs.Convert.%ImplicitAs.type (%ImplicitAs.type.edb) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.152)]
  962. // CHECK:STDOUT: %Self.binding.as_type: type = symbolic_binding_type Self, 1, %Self [symbolic = %Self.binding.as_type (constants.%Self.binding.as_type.3b8)]
  963. // CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.binding.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.519)]
  964. // CHECK:STDOUT: %pattern_type.2: type = pattern_type %T [symbolic = %pattern_type.2 (constants.%pattern_type.7dc)]
  965. // CHECK:STDOUT:
  966. // CHECK:STDOUT: fn;
  967. // CHECK:STDOUT: }
  968. // CHECK:STDOUT:
  969. // CHECK:STDOUT: fn @i32.builtin.as.ImplicitAs.impl.Convert = "int.convert_checked" [from "core.carbon"];
  970. // CHECK:STDOUT:
  971. // CHECK:STDOUT: fn @Core.IntLiteral.as.ImplicitAs.impl.Convert = "int.convert_checked" [from "core.carbon"];
  972. // CHECK:STDOUT:
  973. // CHECK:STDOUT: fn @__global_init() {
  974. // CHECK:STDOUT: !entry:
  975. // CHECK:STDOUT: %int_3.loc4_49: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  976. // CHECK:STDOUT: %int_4.loc4_52: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  977. // CHECK:STDOUT: %int_3.loc4_56: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
  978. // CHECK:STDOUT: %int_32.loc4_61: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  979. // CHECK:STDOUT: %Int.call.loc4_61: init type = call constants.%Int(%int_32.loc4_61) [concrete = constants.%i32.builtin]
  980. // CHECK:STDOUT: %.loc4_61.1: type = value_of_initializer %Int.call.loc4_61 [concrete = constants.%i32.builtin]
  981. // CHECK:STDOUT: %.loc4_61.2: type = converted %Int.call.loc4_61, %.loc4_61.1 [concrete = constants.%i32.builtin]
  982. // CHECK:STDOUT: %impl.elem0.loc4_58: %.8dd = impl_witness_access constants.%As.impl_witness, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert]
  983. // CHECK:STDOUT: %bound_method.loc4_58: <bound method> = bound_method %int_3.loc4_56, %impl.elem0.loc4_58 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.55c]
  984. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc4_58: init %i32.builtin = call %bound_method.loc4_58(%int_3.loc4_56) [concrete = constants.%int_3.a0f]
  985. // CHECK:STDOUT: %.loc4_58.1: %i32.builtin = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc4_58 [concrete = constants.%int_3.a0f]
  986. // CHECK:STDOUT: %.loc4_58.2: %i32.builtin = converted %int_3.loc4_56, %.loc4_58.1 [concrete = constants.%int_3.a0f]
  987. // CHECK:STDOUT: %int_4.loc4_69: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1]
  988. // CHECK:STDOUT: %int_32.loc4_74: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  989. // CHECK:STDOUT: %Int.call.loc4_74: init type = call constants.%Int(%int_32.loc4_74) [concrete = constants.%i32.builtin]
  990. // CHECK:STDOUT: %.loc4_74.1: type = value_of_initializer %Int.call.loc4_74 [concrete = constants.%i32.builtin]
  991. // CHECK:STDOUT: %.loc4_74.2: type = converted %Int.call.loc4_74, %.loc4_74.1 [concrete = constants.%i32.builtin]
  992. // CHECK:STDOUT: %impl.elem0.loc4_71: %.8dd = impl_witness_access constants.%As.impl_witness, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert]
  993. // CHECK:STDOUT: %bound_method.loc4_71: <bound method> = bound_method %int_4.loc4_69, %impl.elem0.loc4_71 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound.eb9]
  994. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call.loc4_71: init %i32.builtin = call %bound_method.loc4_71(%int_4.loc4_69) [concrete = constants.%int_4.4f1]
  995. // CHECK:STDOUT: %.loc4_71.1: %i32.builtin = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call.loc4_71 [concrete = constants.%int_4.4f1]
  996. // CHECK:STDOUT: %.loc4_71.2: %i32.builtin = converted %int_4.loc4_69, %.loc4_71.1 [concrete = constants.%int_4.4f1]
  997. // CHECK:STDOUT: %impl.elem0.loc4_66: %.f31 = impl_witness_access constants.%AddWith.impl_witness, element0 [concrete = constants.%i32.builtin.as.AddWith.impl.Op]
  998. // CHECK:STDOUT: %bound_method.loc4_66: <bound method> = bound_method %.loc4_58.2, %impl.elem0.loc4_66 [concrete = constants.%i32.builtin.as.AddWith.impl.Op.bound.81b]
  999. // CHECK:STDOUT: %i32.builtin.as.AddWith.impl.Op.call: init %i32.builtin = call %bound_method.loc4_66(%.loc4_58.2, %.loc4_71.2) [concrete = constants.%int_7]
  1000. // CHECK:STDOUT: %.loc4_78.1: %tuple.type = tuple_literal (%int_3.loc4_49, %int_4.loc4_52, %i32.builtin.as.AddWith.impl.Op.call)
  1001. // CHECK:STDOUT: %impl.elem0.loc4_78.1: %.63c = impl_witness_access constants.%ImplicitAs.impl_witness.c15, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert]
  1002. // CHECK:STDOUT: %bound_method.loc4_78.1: <bound method> = bound_method %int_3.loc4_49, %impl.elem0.loc4_78.1 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.c88]
  1003. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc4_78.1: init %i32.builtin = call %bound_method.loc4_78.1(%int_3.loc4_49) [concrete = constants.%int_3.a0f]
  1004. // CHECK:STDOUT: %.loc4_78.2: init %i32.builtin = converted %int_3.loc4_49, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc4_78.1 [concrete = constants.%int_3.a0f]
  1005. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
  1006. // CHECK:STDOUT: %.loc4_78.3: ref %i32.builtin = array_index file.%arr.var, %int_0
  1007. // CHECK:STDOUT: %.loc4_78.4: init %i32.builtin = initialize_from %.loc4_78.2 to %.loc4_78.3 [concrete = constants.%int_3.a0f]
  1008. // CHECK:STDOUT: %impl.elem0.loc4_78.2: %.63c = impl_witness_access constants.%ImplicitAs.impl_witness.c15, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert]
  1009. // CHECK:STDOUT: %bound_method.loc4_78.2: <bound method> = bound_method %int_4.loc4_52, %impl.elem0.loc4_78.2 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.6b7]
  1010. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc4_78.2: init %i32.builtin = call %bound_method.loc4_78.2(%int_4.loc4_52) [concrete = constants.%int_4.4f1]
  1011. // CHECK:STDOUT: %.loc4_78.5: init %i32.builtin = converted %int_4.loc4_52, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc4_78.2 [concrete = constants.%int_4.4f1]
  1012. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  1013. // CHECK:STDOUT: %.loc4_78.6: ref %i32.builtin = array_index file.%arr.var, %int_1
  1014. // CHECK:STDOUT: %.loc4_78.7: init %i32.builtin = initialize_from %.loc4_78.5 to %.loc4_78.6 [concrete = constants.%int_4.4f1]
  1015. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1016. // CHECK:STDOUT: %.loc4_78.8: ref %i32.builtin = array_index file.%arr.var, %int_2
  1017. // CHECK:STDOUT: %.loc4_78.9: init %i32.builtin = initialize_from %i32.builtin.as.AddWith.impl.Op.call to %.loc4_78.8 [concrete = constants.%int_7]
  1018. // CHECK:STDOUT: %.loc4_78.10: init %array_type = array_init (%.loc4_78.4, %.loc4_78.7, %.loc4_78.9) to file.%arr.var [concrete = constants.%array]
  1019. // CHECK:STDOUT: %.loc4_1: init %array_type = converted %.loc4_78.1, %.loc4_78.10 [concrete = constants.%array]
  1020. // CHECK:STDOUT: assign file.%arr.var, %.loc4_1
  1021. // CHECK:STDOUT: return
  1022. // CHECK:STDOUT: }
  1023. // CHECK:STDOUT:
  1024. // CHECK:STDOUT: specific @As(constants.%T) {
  1025. // CHECK:STDOUT: %T => constants.%T
  1026. // CHECK:STDOUT: }
  1027. // CHECK:STDOUT:
  1028. // CHECK:STDOUT: specific @As.Convert(constants.%T, constants.%Self.4b9) {
  1029. // CHECK:STDOUT: %T => constants.%T
  1030. // CHECK:STDOUT: %As.type => constants.%As.type.8d8
  1031. // CHECK:STDOUT: %Self => constants.%Self.4b9
  1032. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.40a
  1033. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.1b6
  1034. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.7dc
  1035. // CHECK:STDOUT: }
  1036. // CHECK:STDOUT:
  1037. // CHECK:STDOUT: specific @As(constants.%i32.builtin) {
  1038. // CHECK:STDOUT: %T => constants.%i32.builtin
  1039. // CHECK:STDOUT:
  1040. // CHECK:STDOUT: !definition:
  1041. // CHECK:STDOUT: %As.type => constants.%As.type.a29
  1042. // CHECK:STDOUT: %Self => constants.%Self.6b6
  1043. // CHECK:STDOUT: %As.Convert.type => constants.%As.Convert.type.378
  1044. // CHECK:STDOUT: %As.Convert => constants.%As.Convert.e51
  1045. // CHECK:STDOUT: %As.assoc_type => constants.%As.assoc_type.bc2
  1046. // CHECK:STDOUT: %assoc0 => constants.%assoc0.9fb
  1047. // CHECK:STDOUT: }
  1048. // CHECK:STDOUT:
  1049. // CHECK:STDOUT: specific @AddWith(constants.%T) {
  1050. // CHECK:STDOUT: %T => constants.%T
  1051. // CHECK:STDOUT: }
  1052. // CHECK:STDOUT:
  1053. // CHECK:STDOUT: specific @AddWith.Op(constants.%T, constants.%Self.25f) {
  1054. // CHECK:STDOUT: %T => constants.%T
  1055. // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.5d0
  1056. // CHECK:STDOUT: %Self => constants.%Self.25f
  1057. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.ce3
  1058. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.378
  1059. // CHECK:STDOUT: }
  1060. // CHECK:STDOUT:
  1061. // CHECK:STDOUT: specific @AddWith(constants.%i32.builtin) {
  1062. // CHECK:STDOUT: %T => constants.%i32.builtin
  1063. // CHECK:STDOUT:
  1064. // CHECK:STDOUT: !definition:
  1065. // CHECK:STDOUT: %AddWith.type => constants.%AddWith.type.2a3
  1066. // CHECK:STDOUT: %Self => constants.%Self.b27
  1067. // CHECK:STDOUT: %AddWith.Op.type => constants.%AddWith.Op.type.0b7
  1068. // CHECK:STDOUT: %AddWith.Op => constants.%AddWith.Op.9d6
  1069. // CHECK:STDOUT: %AddWith.assoc_type => constants.%AddWith.assoc_type.dff
  1070. // CHECK:STDOUT: %assoc0 => constants.%assoc0.7f1
  1071. // CHECK:STDOUT: }
  1072. // CHECK:STDOUT:
  1073. // CHECK:STDOUT: specific @ImplicitAs(constants.%T) {
  1074. // CHECK:STDOUT: %T => constants.%T
  1075. // CHECK:STDOUT: }
  1076. // CHECK:STDOUT:
  1077. // CHECK:STDOUT: specific @ImplicitAs.Convert(constants.%T, constants.%Self.152) {
  1078. // CHECK:STDOUT: %T => constants.%T
  1079. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.edb
  1080. // CHECK:STDOUT: %Self => constants.%Self.152
  1081. // CHECK:STDOUT: %Self.binding.as_type => constants.%Self.binding.as_type.3b8
  1082. // CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.519
  1083. // CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.7dc
  1084. // CHECK:STDOUT: }
  1085. // CHECK:STDOUT:
  1086. // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
  1087. // CHECK:STDOUT: %T => Core.IntLiteral
  1088. // CHECK:STDOUT:
  1089. // CHECK:STDOUT: !definition:
  1090. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.7a9
  1091. // CHECK:STDOUT: %Self => constants.%Self.d4e
  1092. // CHECK:STDOUT: %ImplicitAs.Convert.type => constants.%ImplicitAs.Convert.type.71e
  1093. // CHECK:STDOUT: %ImplicitAs.Convert => constants.%ImplicitAs.Convert.0e2
  1094. // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.959
  1095. // CHECK:STDOUT: %assoc0 => constants.%assoc0.8c4
  1096. // CHECK:STDOUT: }
  1097. // CHECK:STDOUT:
  1098. // CHECK:STDOUT: specific @ImplicitAs(constants.%i32.builtin) {
  1099. // CHECK:STDOUT: %T => constants.%i32.builtin
  1100. // CHECK:STDOUT:
  1101. // CHECK:STDOUT: !definition:
  1102. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.873
  1103. // CHECK:STDOUT: %Self => constants.%Self.fef
  1104. // CHECK:STDOUT: %ImplicitAs.Convert.type => constants.%ImplicitAs.Convert.type.059
  1105. // CHECK:STDOUT: %ImplicitAs.Convert => constants.%ImplicitAs.Convert.4d7
  1106. // CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.398
  1107. // CHECK:STDOUT: %assoc0 => constants.%assoc0.6fd
  1108. // CHECK:STDOUT: }
  1109. // CHECK:STDOUT: