call_from_operator.carbon 93 KB

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