call_from_operator.carbon 78 KB

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