call_from_operator.carbon 94 KB

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