call_from_operator.carbon 97 KB

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