import_builtin_call.carbon 88 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon
  10. // --- generic_impl.carbon
  11. library "[[@TEST_NAME]]";
  12. interface Add {
  13. fn Op[self: Self](other: Self) -> Self;
  14. }
  15. fn IntLiteral() -> type = "int_literal.make_type";
  16. fn Int(n: IntLiteral()) -> type = "int.make_type_signed";
  17. class MyInt(N:! IntLiteral()) {
  18. adapt Int(N);
  19. }
  20. impl forall [N:! IntLiteral()] MyInt(N) as Add {
  21. fn Op[self: Self](other: Self) -> Self = "int.sadd";
  22. }
  23. fn Double[N:! IntLiteral()](x: MyInt(N)) -> MyInt(N) {
  24. return x.(Add.Op)(x);
  25. }
  26. // --- use_generic_impl.carbon
  27. library "[[@TEST_NAME]]";
  28. import library "generic_impl";
  29. // TODO: The call below crashes if this one is not present because the generics
  30. // get imported in a bad order.
  31. fn LocalDouble(x: MyInt(64)) -> MyInt(64) {
  32. return x.(Add.Op)(x);
  33. }
  34. fn CallImportedDouble(n: MyInt(64)) -> MyInt(64) {
  35. return Double(n);
  36. }
  37. // --- convert_symbolic.carbon
  38. library "[[@TEST_NAME]]";
  39. fn IntLiteral() -> type = "int_literal.make_type";
  40. fn Int(n: IntLiteral()) -> type = "int.make_type_signed";
  41. fn ToLiteral(n: Int(32)) -> IntLiteral() = "int.convert_checked";
  42. fn FromLiteral(n: IntLiteral()) -> Int(32) = "int.convert_checked";
  43. fn Make(N:! Int(32)) -> Int(ToLiteral(N)) { return Make(N); }
  44. class OtherInt {
  45. adapt Int(32);
  46. fn ToLiteral[self: Self]() -> IntLiteral();
  47. };
  48. fn OtherInt.ToLiteral[self: Self]() -> IntLiteral() = "int.convert_checked";
  49. fn MakeFromClass(N:! OtherInt) -> Int(N.ToLiteral()) { return MakeFromClass(N); }
  50. // --- use_convert_symbolic.carbon
  51. library "[[@TEST_NAME]]";
  52. import library "convert_symbolic";
  53. var m: Int(64) = Make(FromLiteral(64));
  54. var n: Int(64) = MakeFromClass(FromLiteral(64) as OtherInt);
  55. // CHECK:STDOUT: --- generic_impl.carbon
  56. // CHECK:STDOUT:
  57. // CHECK:STDOUT: constants {
  58. // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template]
  59. // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic]
  60. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  61. // CHECK:STDOUT: %Op.type.31b: type = fn_type @Op.1 [template]
  62. // CHECK:STDOUT: %Op.d59: %Op.type.31b = struct_value () [template]
  63. // CHECK:STDOUT: %Add.assoc_type: type = assoc_entity_type %Add.type [template]
  64. // CHECK:STDOUT: %assoc0: %Add.assoc_type = assoc_entity element0, @Add.%Op.decl [template]
  65. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
  66. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
  67. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  68. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  69. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  70. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
  71. // CHECK:STDOUT: %MyInt.type: type = generic_class_type @MyInt [template]
  72. // CHECK:STDOUT: %MyInt.generic: %MyInt.type = struct_value () [template]
  73. // CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic]
  74. // CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic]
  75. // CHECK:STDOUT: %require_complete.f1b: <witness> = require_complete_type %iN.builtin [symbolic]
  76. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %iN.builtin [symbolic]
  77. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl), @impl(%N) [symbolic]
  78. // CHECK:STDOUT: %Op.type.883: type = fn_type @Op.2, @impl(%N) [symbolic]
  79. // CHECK:STDOUT: %Op.8bc: %Op.type.883 = struct_value () [symbolic]
  80. // CHECK:STDOUT: %require_complete.fc7: <witness> = require_complete_type %MyInt [symbolic]
  81. // CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, %impl_witness [symbolic]
  82. // CHECK:STDOUT: %Double.type: type = fn_type @Double [template]
  83. // CHECK:STDOUT: %Double: %Double.type = struct_value () [template]
  84. // CHECK:STDOUT: %.dcc: type = fn_type_with_self_type %Op.type.31b, %Add.facet [symbolic]
  85. // CHECK:STDOUT: }
  86. // CHECK:STDOUT:
  87. // CHECK:STDOUT: file {
  88. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  89. // CHECK:STDOUT: .Add = %Add.decl
  90. // CHECK:STDOUT: .IntLiteral = %IntLiteral.decl
  91. // CHECK:STDOUT: .Int = %Int.decl
  92. // CHECK:STDOUT: .MyInt = %MyInt.decl
  93. // CHECK:STDOUT: .Double = %Double.decl
  94. // CHECK:STDOUT: }
  95. // CHECK:STDOUT: %Add.decl: type = interface_decl @Add [template = constants.%Add.type] {} {}
  96. // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] {
  97. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  98. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0
  99. // CHECK:STDOUT: } {
  100. // CHECK:STDOUT: %return.param: ref type = out_param runtime_param0
  101. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] {
  104. // CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n
  105. // CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0
  106. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  107. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1
  108. // CHECK:STDOUT: } {
  109. // CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0
  110. // CHECK:STDOUT: %.loc9_22.1: type = splice_block %.loc9_22.3 [template = Core.IntLiteral] {
  111. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  112. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  113. // CHECK:STDOUT: %.loc9_22.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  114. // CHECK:STDOUT: %.loc9_22.3: type = converted %int_literal.make_type, %.loc9_22.2 [template = Core.IntLiteral]
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param
  117. // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1
  118. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  119. // CHECK:STDOUT: }
  120. // CHECK:STDOUT: %MyInt.decl: %MyInt.type = class_decl @MyInt [template = constants.%MyInt.generic] {
  121. // CHECK:STDOUT: %N.patt.loc11_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)]
  122. // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc11_13.1, runtime_param<none> [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)]
  123. // CHECK:STDOUT: } {
  124. // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<none>
  125. // CHECK:STDOUT: %.loc11_28.1: type = splice_block %.loc11_28.3 [template = Core.IntLiteral] {
  126. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  127. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  128. // CHECK:STDOUT: %.loc11_28.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  129. // CHECK:STDOUT: %.loc11_28.3: type = converted %int_literal.make_type, %.loc11_28.2 [template = Core.IntLiteral]
  130. // CHECK:STDOUT: }
  131. // CHECK:STDOUT: %N.loc11_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc11_13.2 (constants.%N)]
  132. // CHECK:STDOUT: }
  133. // CHECK:STDOUT: impl_decl @impl [template] {
  134. // CHECK:STDOUT: %N.patt.loc15_14.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)]
  135. // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc15_14.1, runtime_param<none> [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)]
  136. // CHECK:STDOUT: } {
  137. // CHECK:STDOUT: %MyInt.ref: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic]
  138. // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc15_14.1 [symbolic = %N.loc15_14.2 (constants.%N)]
  139. // CHECK:STDOUT: %MyInt.loc15_39.1: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc15_39.2 (constants.%MyInt)]
  140. // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type]
  141. // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<none>
  142. // CHECK:STDOUT: %.loc15_29.1: type = splice_block %.loc15_29.3 [template = Core.IntLiteral] {
  143. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  144. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  145. // CHECK:STDOUT: %.loc15_29.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  146. // CHECK:STDOUT: %.loc15_29.3: type = converted %int_literal.make_type, %.loc15_29.2 [template = Core.IntLiteral]
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT: %N.loc15_14.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc15_14.2 (constants.%N)]
  149. // CHECK:STDOUT: }
  150. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl), @impl(constants.%N) [symbolic = @impl.%impl_witness (constants.%impl_witness)]
  151. // CHECK:STDOUT: %Double.decl: %Double.type = fn_decl @Double [template = constants.%Double] {
  152. // CHECK:STDOUT: %N.patt.loc19_11.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc19_11.2 (constants.%N.patt)]
  153. // CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc19_11.1, runtime_param<none> [symbolic = %N.patt.loc19_11.2 (constants.%N.patt)]
  154. // CHECK:STDOUT: %x.patt: @Double.%MyInt.loc19_39.2 (%MyInt) = binding_pattern x
  155. // CHECK:STDOUT: %x.param_patt: @Double.%MyInt.loc19_39.2 (%MyInt) = value_param_pattern %x.patt, runtime_param0
  156. // CHECK:STDOUT: %return.patt: @Double.%MyInt.loc19_39.2 (%MyInt) = return_slot_pattern
  157. // CHECK:STDOUT: %return.param_patt: @Double.%MyInt.loc19_39.2 (%MyInt) = out_param_pattern %return.patt, runtime_param1
  158. // CHECK:STDOUT: } {
  159. // CHECK:STDOUT: %MyInt.ref.loc19_45: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic]
  160. // CHECK:STDOUT: %N.ref.loc19_51: Core.IntLiteral = name_ref N, %N.loc19_11.1 [symbolic = %N.loc19_11.2 (constants.%N)]
  161. // CHECK:STDOUT: %MyInt.loc19_52: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)]
  162. // CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param<none>
  163. // CHECK:STDOUT: %.loc19_26.1: type = splice_block %.loc19_26.3 [template = Core.IntLiteral] {
  164. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  165. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  166. // CHECK:STDOUT: %.loc19_26.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  167. // CHECK:STDOUT: %.loc19_26.3: type = converted %int_literal.make_type, %.loc19_26.2 [template = Core.IntLiteral]
  168. // CHECK:STDOUT: }
  169. // CHECK:STDOUT: %N.loc19_11.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc19_11.2 (constants.%N)]
  170. // CHECK:STDOUT: %x.param: @Double.%MyInt.loc19_39.2 (%MyInt) = value_param runtime_param0
  171. // CHECK:STDOUT: %.loc19_39: type = splice_block %MyInt.loc19_39.1 [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)] {
  172. // CHECK:STDOUT: %MyInt.ref.loc19_32: %MyInt.type = name_ref MyInt, file.%MyInt.decl [template = constants.%MyInt.generic]
  173. // CHECK:STDOUT: %N.ref.loc19_38: Core.IntLiteral = name_ref N, %N.loc19_11.1 [symbolic = %N.loc19_11.2 (constants.%N)]
  174. // CHECK:STDOUT: %MyInt.loc19_39.1: type = class_type @MyInt, @MyInt(constants.%N) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)]
  175. // CHECK:STDOUT: }
  176. // CHECK:STDOUT: %x: @Double.%MyInt.loc19_39.2 (%MyInt) = bind_name x, %x.param
  177. // CHECK:STDOUT: %return.param: ref @Double.%MyInt.loc19_39.2 (%MyInt) = out_param runtime_param1
  178. // CHECK:STDOUT: %return: ref @Double.%MyInt.loc19_39.2 (%MyInt) = return_slot %return.param
  179. // CHECK:STDOUT: }
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT:
  182. // CHECK:STDOUT: interface @Add {
  183. // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  184. // CHECK:STDOUT: %Op.decl: %Op.type.31b = fn_decl @Op.1 [template = constants.%Op.d59] {
  185. // CHECK:STDOUT: %self.patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = binding_pattern self
  186. // CHECK:STDOUT: %self.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param_pattern %self.patt, runtime_param0
  187. // CHECK:STDOUT: %other.patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = binding_pattern other
  188. // CHECK:STDOUT: %other.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param_pattern %other.patt, runtime_param1
  189. // CHECK:STDOUT: %return.patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot_pattern
  190. // CHECK:STDOUT: %return.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param_pattern %return.patt, runtime_param2
  191. // CHECK:STDOUT: } {
  192. // CHECK:STDOUT: %Self.ref.loc5_37: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
  193. // CHECK:STDOUT: %Self.as_type.loc5_37: type = facet_access_type %Self.ref.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  194. // CHECK:STDOUT: %.loc5_37: type = converted %Self.ref.loc5_37, %Self.as_type.loc5_37 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  195. // CHECK:STDOUT: %self.param: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param runtime_param0
  196. // CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] {
  197. // CHECK:STDOUT: %Self.ref.loc5_15: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
  198. // CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref.loc5_15 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  199. // CHECK:STDOUT: %.loc5_15.2: type = converted %Self.ref.loc5_15, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  200. // CHECK:STDOUT: }
  201. // CHECK:STDOUT: %self: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param
  202. // CHECK:STDOUT: %other.param: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param runtime_param1
  203. // CHECK:STDOUT: %.loc5_28.1: type = splice_block %.loc5_28.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] {
  204. // CHECK:STDOUT: %Self.ref.loc5_28: %Add.type = name_ref Self, @Add.%Self [symbolic = %Self (constants.%Self)]
  205. // CHECK:STDOUT: %Self.as_type.loc5_28: type = facet_access_type %Self.ref.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  206. // CHECK:STDOUT: %.loc5_28.2: type = converted %Self.ref.loc5_28, %Self.as_type.loc5_28 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  207. // CHECK:STDOUT: }
  208. // CHECK:STDOUT: %other: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name other, %other.param
  209. // CHECK:STDOUT: %return.param: ref @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = out_param runtime_param2
  210. // CHECK:STDOUT: %return: ref @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type) = return_slot %return.param
  211. // CHECK:STDOUT: }
  212. // CHECK:STDOUT: %assoc0: %Add.assoc_type = assoc_entity element0, %Op.decl [template = constants.%assoc0]
  213. // CHECK:STDOUT:
  214. // CHECK:STDOUT: !members:
  215. // CHECK:STDOUT: .Self = %Self
  216. // CHECK:STDOUT: .Op = %assoc0
  217. // CHECK:STDOUT: witness = (%Op.decl)
  218. // CHECK:STDOUT: }
  219. // CHECK:STDOUT:
  220. // CHECK:STDOUT: generic impl @impl(%N.loc15_14.1: Core.IntLiteral) {
  221. // CHECK:STDOUT: %N.loc15_14.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc15_14.2 (constants.%N)]
  222. // CHECK:STDOUT: %N.patt.loc15_14.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc15_14.2 (constants.%N.patt)]
  223. // CHECK:STDOUT: %MyInt.loc15_39.2: type = class_type @MyInt, @MyInt(%N.loc15_14.2) [symbolic = %MyInt.loc15_39.2 (constants.%MyInt)]
  224. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (%Op.decl), @impl(%N.loc15_14.2) [symbolic = %impl_witness (constants.%impl_witness)]
  225. // CHECK:STDOUT:
  226. // CHECK:STDOUT: !definition:
  227. // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N.loc15_14.2) [symbolic = %Op.type (constants.%Op.type.883)]
  228. // CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)]
  229. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.%MyInt.loc15_39.2 (%MyInt) [symbolic = %require_complete (constants.%require_complete.fc7)]
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: impl: %MyInt.loc15_39.1 as %Add.ref {
  232. // CHECK:STDOUT: %Op.decl: @impl.%Op.type (%Op.type.883) = fn_decl @Op.2 [symbolic = @impl.%Op (constants.%Op.8bc)] {
  233. // CHECK:STDOUT: %self.patt: @Op.2.%MyInt (%MyInt) = binding_pattern self
  234. // CHECK:STDOUT: %self.param_patt: @Op.2.%MyInt (%MyInt) = value_param_pattern %self.patt, runtime_param0
  235. // CHECK:STDOUT: %other.patt: @Op.2.%MyInt (%MyInt) = binding_pattern other
  236. // CHECK:STDOUT: %other.param_patt: @Op.2.%MyInt (%MyInt) = value_param_pattern %other.patt, runtime_param1
  237. // CHECK:STDOUT: %return.patt: @Op.2.%MyInt (%MyInt) = return_slot_pattern
  238. // CHECK:STDOUT: %return.param_patt: @Op.2.%MyInt (%MyInt) = out_param_pattern %return.patt, runtime_param2
  239. // CHECK:STDOUT: } {
  240. // CHECK:STDOUT: %Self.ref.loc16_37: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)]
  241. // CHECK:STDOUT: %self.param: @Op.2.%MyInt (%MyInt) = value_param runtime_param0
  242. // CHECK:STDOUT: %Self.ref.loc16_15: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)]
  243. // CHECK:STDOUT: %self: @Op.2.%MyInt (%MyInt) = bind_name self, %self.param
  244. // CHECK:STDOUT: %other.param: @Op.2.%MyInt (%MyInt) = value_param runtime_param1
  245. // CHECK:STDOUT: %Self.ref.loc16_28: type = name_ref Self, @impl.%MyInt.loc15_39.1 [symbolic = %MyInt (constants.%MyInt)]
  246. // CHECK:STDOUT: %other: @Op.2.%MyInt (%MyInt) = bind_name other, %other.param
  247. // CHECK:STDOUT: %return.param: ref @Op.2.%MyInt (%MyInt) = out_param runtime_param2
  248. // CHECK:STDOUT: %return: ref @Op.2.%MyInt (%MyInt) = return_slot %return.param
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT:
  251. // CHECK:STDOUT: !members:
  252. // CHECK:STDOUT: .Op = %Op.decl
  253. // CHECK:STDOUT: witness = file.%impl_witness
  254. // CHECK:STDOUT: }
  255. // CHECK:STDOUT: }
  256. // CHECK:STDOUT:
  257. // CHECK:STDOUT: generic class @MyInt(%N.loc11_13.1: Core.IntLiteral) {
  258. // CHECK:STDOUT: %N.loc11_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc11_13.2 (constants.%N)]
  259. // CHECK:STDOUT: %N.patt.loc11_13.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc11_13.2 (constants.%N.patt)]
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: !definition:
  262. // CHECK:STDOUT: %iN.builtin: type = int_type signed, %N.loc11_13.2 [symbolic = %iN.builtin (constants.%iN.builtin)]
  263. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @MyInt.%iN.builtin (%iN.builtin) [symbolic = %require_complete (constants.%require_complete.f1b)]
  264. // CHECK:STDOUT: %complete_type.loc13_1.2: <witness> = complete_type_witness @MyInt.%iN.builtin (%iN.builtin) [symbolic = %complete_type.loc13_1.2 (constants.%complete_type)]
  265. // CHECK:STDOUT:
  266. // CHECK:STDOUT: class {
  267. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int]
  268. // CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc11_13.1 [symbolic = %N.loc11_13.2 (constants.%N)]
  269. // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%N.ref) [symbolic = %iN.builtin (constants.%iN.builtin)]
  270. // CHECK:STDOUT: %.loc12_15.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN.builtin (constants.%iN.builtin)]
  271. // CHECK:STDOUT: %.loc12_15.2: type = converted %int.make_type_signed, %.loc12_15.1 [symbolic = %iN.builtin (constants.%iN.builtin)]
  272. // CHECK:STDOUT: adapt_decl %.loc12_15.2 [template]
  273. // CHECK:STDOUT: %complete_type.loc13_1.1: <witness> = complete_type_witness %iN.builtin [symbolic = %complete_type.loc13_1.2 (constants.%complete_type)]
  274. // CHECK:STDOUT: complete_type_witness = %complete_type.loc13_1.1
  275. // CHECK:STDOUT:
  276. // CHECK:STDOUT: !members:
  277. // CHECK:STDOUT: .Self = constants.%MyInt
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT: }
  280. // CHECK:STDOUT:
  281. // CHECK:STDOUT: generic fn @Op.1(@Add.%Self: %Add.type) {
  282. // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  283. // CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)]
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type)](%other.param_patt: @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type)) -> @Op.1.%Self.as_type.loc5_15.1 (%Self.as_type);
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT:
  288. // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type";
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed";
  291. // CHECK:STDOUT:
  292. // CHECK:STDOUT: generic fn @Op.2(@impl.%N.loc15_14.1: Core.IntLiteral) {
  293. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  294. // CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt)]
  295. // CHECK:STDOUT:
  296. // CHECK:STDOUT: !definition:
  297. // CHECK:STDOUT:
  298. // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%MyInt (%MyInt)](%other.param_patt: @Op.2.%MyInt (%MyInt)) -> @Op.2.%MyInt (%MyInt) = "int.sadd";
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: generic fn @Double(%N.loc19_11.1: Core.IntLiteral) {
  302. // CHECK:STDOUT: %N.loc19_11.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc19_11.2 (constants.%N)]
  303. // CHECK:STDOUT: %N.patt.loc19_11.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc19_11.2 (constants.%N.patt)]
  304. // CHECK:STDOUT: %MyInt.loc19_39.2: type = class_type @MyInt, @MyInt(%N.loc19_11.2) [symbolic = %MyInt.loc19_39.2 (constants.%MyInt)]
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: !definition:
  307. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Double.%MyInt.loc19_39.2 (%MyInt) [symbolic = %require_complete (constants.%require_complete.fc7)]
  308. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (@impl.%Op.decl), @impl(%N.loc19_11.2) [symbolic = %impl_witness (constants.%impl_witness)]
  309. // CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt.loc19_39.2, %impl_witness [symbolic = %Add.facet (constants.%Add.facet)]
  310. // CHECK:STDOUT: %.loc20_11: type = fn_type_with_self_type constants.%Op.type.31b, %Add.facet [symbolic = %.loc20_11 (constants.%.dcc)]
  311. // CHECK:STDOUT: %Op.type: type = fn_type @Op.2, @impl(%N.loc19_11.2) [symbolic = %Op.type (constants.%Op.type.883)]
  312. // CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)]
  313. // CHECK:STDOUT:
  314. // CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%x.param_patt: @Double.%MyInt.loc19_39.2 (%MyInt)) -> @Double.%MyInt.loc19_39.2 (%MyInt) {
  315. // CHECK:STDOUT: !entry:
  316. // CHECK:STDOUT: %x.ref.loc20_10: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x
  317. // CHECK:STDOUT: %Add.ref: type = name_ref Add, file.%Add.decl [template = constants.%Add.type]
  318. // CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, @Add.%assoc0 [template = constants.%assoc0]
  319. // CHECK:STDOUT: %impl.elem0: @Double.%.loc20_11 (%.dcc) = impl_witness_access constants.%impl_witness, element0 [symbolic = %Op (constants.%Op.8bc)]
  320. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %x.ref.loc20_10, %impl.elem0
  321. // CHECK:STDOUT: %x.ref.loc20_21: @Double.%MyInt.loc19_39.2 (%MyInt) = name_ref x, %x
  322. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Op.2(constants.%N)
  323. // CHECK:STDOUT: %int.sadd: init @Double.%MyInt.loc19_39.2 (%MyInt) = call %specific_fn(%x.ref.loc20_10, %x.ref.loc20_21)
  324. // CHECK:STDOUT: %.loc20_23.1: @Double.%MyInt.loc19_39.2 (%MyInt) = value_of_initializer %int.sadd
  325. // CHECK:STDOUT: %.loc20_23.2: @Double.%MyInt.loc19_39.2 (%MyInt) = converted %int.sadd, %.loc20_23.1
  326. // CHECK:STDOUT: return %.loc20_23.2
  327. // CHECK:STDOUT: }
  328. // CHECK:STDOUT: }
  329. // CHECK:STDOUT:
  330. // CHECK:STDOUT: specific @Op.1(constants.%Self) {
  331. // CHECK:STDOUT: %Self => constants.%Self
  332. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: specific @MyInt(constants.%N) {
  336. // CHECK:STDOUT: %N.loc11_13.2 => constants.%N
  337. // CHECK:STDOUT: %N.patt.loc11_13.2 => constants.%N
  338. // CHECK:STDOUT:
  339. // CHECK:STDOUT: !definition:
  340. // CHECK:STDOUT: %iN.builtin => constants.%iN.builtin
  341. // CHECK:STDOUT: %require_complete => constants.%require_complete.f1b
  342. // CHECK:STDOUT: %complete_type.loc13_1.2 => constants.%complete_type
  343. // CHECK:STDOUT: }
  344. // CHECK:STDOUT:
  345. // CHECK:STDOUT: specific @impl(constants.%N) {
  346. // CHECK:STDOUT: %N.loc15_14.2 => constants.%N
  347. // CHECK:STDOUT: %N.patt.loc15_14.2 => constants.%N
  348. // CHECK:STDOUT: %MyInt.loc15_39.2 => constants.%MyInt
  349. // CHECK:STDOUT: %impl_witness => constants.%impl_witness
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: !definition:
  352. // CHECK:STDOUT: %Op.type => constants.%Op.type.883
  353. // CHECK:STDOUT: %Op => constants.%Op.8bc
  354. // CHECK:STDOUT: %require_complete => constants.%require_complete.fc7
  355. // CHECK:STDOUT: }
  356. // CHECK:STDOUT:
  357. // CHECK:STDOUT: specific @MyInt(@impl.%N.loc15_14.2) {}
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: specific @impl(%N.loc15_14.2) {}
  360. // CHECK:STDOUT:
  361. // CHECK:STDOUT: specific @Op.2(constants.%N) {
  362. // CHECK:STDOUT: %N => constants.%N
  363. // CHECK:STDOUT: %MyInt => constants.%MyInt
  364. // CHECK:STDOUT:
  365. // CHECK:STDOUT: !definition:
  366. // CHECK:STDOUT: }
  367. // CHECK:STDOUT:
  368. // CHECK:STDOUT: specific @MyInt(@Op.2.%N) {}
  369. // CHECK:STDOUT:
  370. // CHECK:STDOUT: specific @Op.1(constants.%Add.facet) {
  371. // CHECK:STDOUT: %Self => constants.%Add.facet
  372. // CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%MyInt
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: specific @Double(constants.%N) {
  376. // CHECK:STDOUT: %N.loc19_11.2 => constants.%N
  377. // CHECK:STDOUT: %N.patt.loc19_11.2 => constants.%N
  378. // CHECK:STDOUT: %MyInt.loc19_39.2 => constants.%MyInt
  379. // CHECK:STDOUT: }
  380. // CHECK:STDOUT:
  381. // CHECK:STDOUT: specific @MyInt(@Double.%N.loc19_11.2) {}
  382. // CHECK:STDOUT:
  383. // CHECK:STDOUT: specific @impl(@Double.%N.loc19_11.2) {}
  384. // CHECK:STDOUT:
  385. // CHECK:STDOUT: --- use_generic_impl.carbon
  386. // CHECK:STDOUT:
  387. // CHECK:STDOUT: constants {
  388. // CHECK:STDOUT: %MyInt.type: type = generic_class_type @MyInt [template]
  389. // CHECK:STDOUT: %MyInt.generic: %MyInt.type = struct_value () [template]
  390. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  391. // CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic]
  392. // CHECK:STDOUT: %complete_type.a87: <witness> = complete_type_witness %iN.builtin [symbolic]
  393. // CHECK:STDOUT: %MyInt.09f: type = class_type @MyInt, @MyInt(%N) [symbolic]
  394. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
  395. // CHECK:STDOUT: %require_complete.f1b: <witness> = require_complete_type %iN.builtin [symbolic]
  396. // CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
  397. // CHECK:STDOUT: %MyInt.f30: type = class_type @MyInt, @MyInt(%int_64) [template]
  398. // CHECK:STDOUT: %LocalDouble.type: type = fn_type @LocalDouble [template]
  399. // CHECK:STDOUT: %LocalDouble: %LocalDouble.type = struct_value () [template]
  400. // CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [template]
  401. // CHECK:STDOUT: %complete_type.4a1: <witness> = complete_type_witness %i64.builtin [template]
  402. // CHECK:STDOUT: %Add.type: type = facet_type <@Add> [template]
  403. // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic]
  404. // CHECK:STDOUT: %Add.assoc_type: type = assoc_entity_type %Add.type [template]
  405. // CHECK:STDOUT: %assoc0: %Add.assoc_type = assoc_entity element0, imports.%Main.import_ref.5a3 [template]
  406. // CHECK:STDOUT: %impl_witness.3a3: <witness> = impl_witness (imports.%Main.import_ref.19b), @impl(%N) [symbolic]
  407. // CHECK:STDOUT: %Op.type.883: type = fn_type @Op.1, @impl(%N) [symbolic]
  408. // CHECK:STDOUT: %Op.8bc: %Op.type.883 = struct_value () [symbolic]
  409. // CHECK:STDOUT: %require_complete.fc7: <witness> = require_complete_type %MyInt.09f [symbolic]
  410. // CHECK:STDOUT: %impl_witness.8d6: <witness> = impl_witness (imports.%Main.import_ref.19b), @impl(%int_64) [template]
  411. // CHECK:STDOUT: %impl_witness.7e5be3.1: <witness> = impl_witness (imports.%Main.import_ref.464c51.1), @impl(%N) [symbolic]
  412. // CHECK:STDOUT: %Op.type.5a6: type = fn_type @Op.1, @impl(%int_64) [template]
  413. // CHECK:STDOUT: %Op.cf9: %Op.type.5a6 = struct_value () [template]
  414. // CHECK:STDOUT: %Op.type.31b: type = fn_type @Op.2 [template]
  415. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic]
  416. // CHECK:STDOUT: %Add.facet.3ca: %Add.type = facet_value %MyInt.f30, %impl_witness.8d6 [template]
  417. // CHECK:STDOUT: %.3ca: type = fn_type_with_self_type %Op.type.31b, %Add.facet.3ca [template]
  418. // CHECK:STDOUT: %CallImportedDouble.type: type = fn_type @CallImportedDouble [template]
  419. // CHECK:STDOUT: %CallImportedDouble: %CallImportedDouble.type = struct_value () [template]
  420. // CHECK:STDOUT: %Double.type: type = fn_type @Double [template]
  421. // CHECK:STDOUT: %Double: %Double.type = struct_value () [template]
  422. // CHECK:STDOUT: %impl_witness.7e5be3.2: <witness> = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%N) [symbolic]
  423. // CHECK:STDOUT: %Add.facet.9a8: %Add.type = facet_value %MyInt.09f, %impl_witness.7e5be3.2 [symbolic]
  424. // CHECK:STDOUT: %.72d: type = fn_type_with_self_type %Op.type.31b, %Add.facet.9a8 [symbolic]
  425. // CHECK:STDOUT: %Double.specific_fn: <specific function> = specific_function %Double, @Double(%int_64) [template]
  426. // CHECK:STDOUT: %impl_witness.bb3: <witness> = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%int_64) [template]
  427. // CHECK:STDOUT: %Add.facet.22c: %Add.type = facet_value %MyInt.f30, %impl_witness.bb3 [template]
  428. // CHECK:STDOUT: %.41c: type = fn_type_with_self_type %Op.type.31b, %Add.facet.22c [template]
  429. // CHECK:STDOUT: }
  430. // CHECK:STDOUT:
  431. // CHECK:STDOUT: imports {
  432. // CHECK:STDOUT: %Main.Add: type = import_ref Main//generic_impl, Add, loaded [template = constants.%Add.type]
  433. // CHECK:STDOUT: %Main.IntLiteral = import_ref Main//generic_impl, IntLiteral, unloaded
  434. // CHECK:STDOUT: %Main.Int = import_ref Main//generic_impl, Int, unloaded
  435. // CHECK:STDOUT: %Main.MyInt: %MyInt.type = import_ref Main//generic_impl, MyInt, loaded [template = constants.%MyInt.generic]
  436. // CHECK:STDOUT: %Main.Double: %Double.type = import_ref Main//generic_impl, Double, loaded [template = constants.%Double]
  437. // CHECK:STDOUT: %Main.import_ref.50eccf.1: Core.IntLiteral = import_ref Main//generic_impl, loc11_13, loaded [symbolic = @MyInt.%N (constants.%N)]
  438. // CHECK:STDOUT: %Main.import_ref.9e9: <witness> = import_ref Main//generic_impl, loc13_1, loaded [symbolic = @MyInt.%complete_type (constants.%complete_type.a87)]
  439. // CHECK:STDOUT: %Main.import_ref.697 = import_ref Main//generic_impl, inst89 [no loc], unloaded
  440. // CHECK:STDOUT: %Main.import_ref.07c = import_ref Main//generic_impl, inst15 [no loc], unloaded
  441. // CHECK:STDOUT: %Main.import_ref.db7: %Add.assoc_type = import_ref Main//generic_impl, loc5_41, loaded [template = constants.%assoc0]
  442. // CHECK:STDOUT: %Main.Op = import_ref Main//generic_impl, Op, unloaded
  443. // CHECK:STDOUT: %Main.import_ref.33b: <witness> = import_ref Main//generic_impl, loc15_48, loaded [symbolic = @impl.%impl_witness (constants.%impl_witness.7e5be3.1)]
  444. // CHECK:STDOUT: %Main.import_ref.50eccf.2: Core.IntLiteral = import_ref Main//generic_impl, loc15_14, loaded [symbolic = @impl.%N (constants.%N)]
  445. // CHECK:STDOUT: %Main.import_ref.719: type = import_ref Main//generic_impl, loc15_39, loaded [symbolic = @impl.%MyInt (constants.%MyInt.09f)]
  446. // CHECK:STDOUT: %Main.import_ref.bf0: type = import_ref Main//generic_impl, loc15_44, loaded [template = constants.%Add.type]
  447. // CHECK:STDOUT: %Main.import_ref.19b: @impl.%Op.type (%Op.type.883) = import_ref Main//generic_impl, loc16_42, loaded [symbolic = @impl.%Op (constants.%Op.8bc)]
  448. // CHECK:STDOUT: %Main.import_ref.50eccf.3: Core.IntLiteral = import_ref Main//generic_impl, loc15_14, loaded [symbolic = @impl.%N (constants.%N)]
  449. // CHECK:STDOUT: %Main.import_ref.e5e: %Add.type = import_ref Main//generic_impl, inst15 [no loc], loaded [symbolic = constants.%Self]
  450. // CHECK:STDOUT: %Main.import_ref.50eccf.4: Core.IntLiteral = import_ref Main//generic_impl, loc19_11, loaded [symbolic = @Double.%N (constants.%N)]
  451. // CHECK:STDOUT: %Main.import_ref.464c51.2 = import_ref Main//generic_impl, loc16_42, unloaded
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT:
  454. // CHECK:STDOUT: file {
  455. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  456. // CHECK:STDOUT: .Add = imports.%Main.Add
  457. // CHECK:STDOUT: .IntLiteral = imports.%Main.IntLiteral
  458. // CHECK:STDOUT: .Int = imports.%Main.Int
  459. // CHECK:STDOUT: .MyInt = imports.%Main.MyInt
  460. // CHECK:STDOUT: .Double = imports.%Main.Double
  461. // CHECK:STDOUT: .LocalDouble = %LocalDouble.decl
  462. // CHECK:STDOUT: .CallImportedDouble = %CallImportedDouble.decl
  463. // CHECK:STDOUT: }
  464. // CHECK:STDOUT: %default.import = import <none>
  465. // CHECK:STDOUT: %LocalDouble.decl: %LocalDouble.type = fn_decl @LocalDouble [template = constants.%LocalDouble] {
  466. // CHECK:STDOUT: %x.patt: %MyInt.f30 = binding_pattern x
  467. // CHECK:STDOUT: %x.param_patt: %MyInt.f30 = value_param_pattern %x.patt, runtime_param0
  468. // CHECK:STDOUT: %return.patt: %MyInt.f30 = return_slot_pattern
  469. // CHECK:STDOUT: %return.param_patt: %MyInt.f30 = out_param_pattern %return.patt, runtime_param1
  470. // CHECK:STDOUT: } {
  471. // CHECK:STDOUT: %MyInt.ref.loc8_33: %MyInt.type = name_ref MyInt, imports.%Main.MyInt [template = constants.%MyInt.generic]
  472. // CHECK:STDOUT: %int_64.loc8_39: Core.IntLiteral = int_value 64 [template = constants.%int_64]
  473. // CHECK:STDOUT: %MyInt.loc8_41: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.f30]
  474. // CHECK:STDOUT: %x.param: %MyInt.f30 = value_param runtime_param0
  475. // CHECK:STDOUT: %.loc8: type = splice_block %MyInt.loc8_27 [template = constants.%MyInt.f30] {
  476. // CHECK:STDOUT: %MyInt.ref.loc8_19: %MyInt.type = name_ref MyInt, imports.%Main.MyInt [template = constants.%MyInt.generic]
  477. // CHECK:STDOUT: %int_64.loc8_25: Core.IntLiteral = int_value 64 [template = constants.%int_64]
  478. // CHECK:STDOUT: %MyInt.loc8_27: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.f30]
  479. // CHECK:STDOUT: }
  480. // CHECK:STDOUT: %x: %MyInt.f30 = bind_name x, %x.param
  481. // CHECK:STDOUT: %return.param: ref %MyInt.f30 = out_param runtime_param1
  482. // CHECK:STDOUT: %return: ref %MyInt.f30 = return_slot %return.param
  483. // CHECK:STDOUT: }
  484. // CHECK:STDOUT: %CallImportedDouble.decl: %CallImportedDouble.type = fn_decl @CallImportedDouble [template = constants.%CallImportedDouble] {
  485. // CHECK:STDOUT: %n.patt: %MyInt.f30 = binding_pattern n
  486. // CHECK:STDOUT: %n.param_patt: %MyInt.f30 = value_param_pattern %n.patt, runtime_param0
  487. // CHECK:STDOUT: %return.patt: %MyInt.f30 = return_slot_pattern
  488. // CHECK:STDOUT: %return.param_patt: %MyInt.f30 = out_param_pattern %return.patt, runtime_param1
  489. // CHECK:STDOUT: } {
  490. // CHECK:STDOUT: %MyInt.ref.loc12_40: %MyInt.type = name_ref MyInt, imports.%Main.MyInt [template = constants.%MyInt.generic]
  491. // CHECK:STDOUT: %int_64.loc12_46: Core.IntLiteral = int_value 64 [template = constants.%int_64]
  492. // CHECK:STDOUT: %MyInt.loc12_48: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.f30]
  493. // CHECK:STDOUT: %n.param: %MyInt.f30 = value_param runtime_param0
  494. // CHECK:STDOUT: %.loc12: type = splice_block %MyInt.loc12_34 [template = constants.%MyInt.f30] {
  495. // CHECK:STDOUT: %MyInt.ref.loc12_26: %MyInt.type = name_ref MyInt, imports.%Main.MyInt [template = constants.%MyInt.generic]
  496. // CHECK:STDOUT: %int_64.loc12_32: Core.IntLiteral = int_value 64 [template = constants.%int_64]
  497. // CHECK:STDOUT: %MyInt.loc12_34: type = class_type @MyInt, @MyInt(constants.%int_64) [template = constants.%MyInt.f30]
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT: %n: %MyInt.f30 = bind_name n, %n.param
  500. // CHECK:STDOUT: %return.param: ref %MyInt.f30 = out_param runtime_param1
  501. // CHECK:STDOUT: %return: ref %MyInt.f30 = return_slot %return.param
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT: }
  504. // CHECK:STDOUT:
  505. // CHECK:STDOUT: interface @Add [from "generic_impl.carbon"] {
  506. // CHECK:STDOUT: !members:
  507. // CHECK:STDOUT: .Self = imports.%Main.import_ref.07c
  508. // CHECK:STDOUT: .Op = imports.%Main.import_ref.db7
  509. // CHECK:STDOUT: witness = (imports.%Main.Op)
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: generic impl @impl(imports.%Main.import_ref.50eccf.2: Core.IntLiteral) [from "generic_impl.carbon"] {
  513. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  514. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  515. // CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.09f)]
  516. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.19b), @impl(%N) [symbolic = %impl_witness (constants.%impl_witness.3a3)]
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: !definition:
  519. // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @impl(%N) [symbolic = %Op.type (constants.%Op.type.883)]
  520. // CHECK:STDOUT: %Op: @impl.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)]
  521. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @impl.%MyInt (%MyInt.09f) [symbolic = %require_complete (constants.%require_complete.fc7)]
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: impl: imports.%Main.import_ref.719 as imports.%Main.import_ref.bf0 {
  524. // CHECK:STDOUT: !members:
  525. // CHECK:STDOUT: witness = imports.%Main.import_ref.33b
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT: }
  528. // CHECK:STDOUT:
  529. // CHECK:STDOUT: generic class @MyInt(imports.%Main.import_ref.50eccf.1: Core.IntLiteral) [from "generic_impl.carbon"] {
  530. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  531. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: !definition:
  534. // CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic = %iN.builtin (constants.%iN.builtin)]
  535. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @MyInt.%iN.builtin (%iN.builtin) [symbolic = %require_complete (constants.%require_complete.f1b)]
  536. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness @MyInt.%iN.builtin (%iN.builtin) [symbolic = %complete_type (constants.%complete_type.a87)]
  537. // CHECK:STDOUT:
  538. // CHECK:STDOUT: class {
  539. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.9e9
  540. // CHECK:STDOUT:
  541. // CHECK:STDOUT: !members:
  542. // CHECK:STDOUT: .Self = imports.%Main.import_ref.697
  543. // CHECK:STDOUT: }
  544. // CHECK:STDOUT: }
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: fn @LocalDouble(%x.param_patt: %MyInt.f30) -> %MyInt.f30 {
  547. // CHECK:STDOUT: !entry:
  548. // CHECK:STDOUT: %x.ref.loc9_10: %MyInt.f30 = name_ref x, %x
  549. // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%Main.Add [template = constants.%Add.type]
  550. // CHECK:STDOUT: %Op.ref: %Add.assoc_type = name_ref Op, imports.%Main.import_ref.db7 [template = constants.%assoc0]
  551. // CHECK:STDOUT: %impl.elem0: %.3ca = impl_witness_access constants.%impl_witness.8d6, element0 [template = constants.%Op.cf9]
  552. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %x.ref.loc9_10, %impl.elem0
  553. // CHECK:STDOUT: %x.ref.loc9_21: %MyInt.f30 = name_ref x, %x
  554. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Op.1(constants.%int_64)
  555. // CHECK:STDOUT: %int.sadd: init %MyInt.f30 = call %specific_fn(%x.ref.loc9_10, %x.ref.loc9_21)
  556. // CHECK:STDOUT: %.loc9_23.1: %MyInt.f30 = value_of_initializer %int.sadd
  557. // CHECK:STDOUT: %.loc9_23.2: %MyInt.f30 = converted %int.sadd, %.loc9_23.1
  558. // CHECK:STDOUT: return %.loc9_23.2
  559. // CHECK:STDOUT: }
  560. // CHECK:STDOUT:
  561. // CHECK:STDOUT: generic fn @Op.1(imports.%Main.import_ref.50eccf.3: Core.IntLiteral) [from "generic_impl.carbon"] {
  562. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  563. // CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.09f)]
  564. // CHECK:STDOUT:
  565. // CHECK:STDOUT: !definition:
  566. // CHECK:STDOUT:
  567. // CHECK:STDOUT: fn[%self.param_patt: @Op.1.%MyInt (%MyInt.09f)](%other.param_patt: @Op.1.%MyInt (%MyInt.09f)) -> @Op.1.%MyInt (%MyInt.09f) = "int.sadd";
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: generic fn @Op.2(imports.%Main.import_ref.e5e: %Add.type) [from "generic_impl.carbon"] {
  571. // CHECK:STDOUT: %Self: %Add.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
  572. // CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: fn[%self.param_patt: @Op.2.%Self.as_type (%Self.as_type)](%other.param_patt: @Op.2.%Self.as_type (%Self.as_type)) -> @Op.2.%Self.as_type (%Self.as_type);
  575. // CHECK:STDOUT: }
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: fn @CallImportedDouble(%n.param_patt: %MyInt.f30) -> %MyInt.f30 {
  578. // CHECK:STDOUT: !entry:
  579. // CHECK:STDOUT: %Double.ref: %Double.type = name_ref Double, imports.%Main.Double [template = constants.%Double]
  580. // CHECK:STDOUT: %n.ref: %MyInt.f30 = name_ref n, %n
  581. // CHECK:STDOUT: %Double.specific_fn: <specific function> = specific_function %Double.ref, @Double(constants.%int_64) [template = constants.%Double.specific_fn]
  582. // CHECK:STDOUT: %Double.call: init %MyInt.f30 = call %Double.specific_fn(%n.ref)
  583. // CHECK:STDOUT: %.loc13_19.1: %MyInt.f30 = value_of_initializer %Double.call
  584. // CHECK:STDOUT: %.loc13_19.2: %MyInt.f30 = converted %Double.call, %.loc13_19.1
  585. // CHECK:STDOUT: return %.loc13_19.2
  586. // CHECK:STDOUT: }
  587. // CHECK:STDOUT:
  588. // CHECK:STDOUT: generic fn @Double(imports.%Main.import_ref.50eccf.4: Core.IntLiteral) [from "generic_impl.carbon"] {
  589. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  590. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  591. // CHECK:STDOUT: %MyInt: type = class_type @MyInt, @MyInt(%N) [symbolic = %MyInt (constants.%MyInt.09f)]
  592. // CHECK:STDOUT:
  593. // CHECK:STDOUT: !definition:
  594. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Double.%MyInt (%MyInt.09f) [symbolic = %require_complete (constants.%require_complete.fc7)]
  595. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.464c51.2), @impl(%N) [symbolic = %impl_witness (constants.%impl_witness.7e5be3.2)]
  596. // CHECK:STDOUT: %Add.facet: %Add.type = facet_value %MyInt, %impl_witness [symbolic = %Add.facet (constants.%Add.facet.9a8)]
  597. // CHECK:STDOUT: %.1: type = fn_type_with_self_type constants.%Op.type.31b, %Add.facet [symbolic = %.1 (constants.%.72d)]
  598. // CHECK:STDOUT: %Op.type: type = fn_type @Op.1, @impl(%N) [symbolic = %Op.type (constants.%Op.type.883)]
  599. // CHECK:STDOUT: %Op: @Double.%Op.type (%Op.type.883) = struct_value () [symbolic = %Op (constants.%Op.8bc)]
  600. // CHECK:STDOUT:
  601. // CHECK:STDOUT: fn[%N.param_patt: Core.IntLiteral](%x.param_patt: @Double.%MyInt (%MyInt.09f)) -> @Double.%MyInt (%MyInt.09f);
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT:
  604. // CHECK:STDOUT: specific @MyInt(constants.%N) {
  605. // CHECK:STDOUT: %N => constants.%N
  606. // CHECK:STDOUT: %N.patt => constants.%N
  607. // CHECK:STDOUT:
  608. // CHECK:STDOUT: !definition:
  609. // CHECK:STDOUT: %iN.builtin => constants.%iN.builtin
  610. // CHECK:STDOUT: %require_complete => constants.%require_complete.f1b
  611. // CHECK:STDOUT: %complete_type => constants.%complete_type.a87
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT:
  614. // CHECK:STDOUT: specific @MyInt(constants.%int_64) {
  615. // CHECK:STDOUT: %N => constants.%int_64
  616. // CHECK:STDOUT: %N.patt => constants.%int_64
  617. // CHECK:STDOUT:
  618. // CHECK:STDOUT: !definition:
  619. // CHECK:STDOUT: %iN.builtin => constants.%i64.builtin
  620. // CHECK:STDOUT: %require_complete => constants.%complete_type.4a1
  621. // CHECK:STDOUT: %complete_type => constants.%complete_type.4a1
  622. // CHECK:STDOUT: }
  623. // CHECK:STDOUT:
  624. // CHECK:STDOUT: specific @impl(constants.%N) {
  625. // CHECK:STDOUT: %N => constants.%N
  626. // CHECK:STDOUT: %N.patt => constants.%N
  627. // CHECK:STDOUT: %MyInt => constants.%MyInt.09f
  628. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.3a3
  629. // CHECK:STDOUT:
  630. // CHECK:STDOUT: !definition:
  631. // CHECK:STDOUT: %Op.type => constants.%Op.type.883
  632. // CHECK:STDOUT: %Op => constants.%Op.8bc
  633. // CHECK:STDOUT: %require_complete => constants.%require_complete.fc7
  634. // CHECK:STDOUT: }
  635. // CHECK:STDOUT:
  636. // CHECK:STDOUT: specific @MyInt(@impl.%N) {}
  637. // CHECK:STDOUT:
  638. // CHECK:STDOUT: specific @impl(%N) {}
  639. // CHECK:STDOUT:
  640. // CHECK:STDOUT: specific @MyInt(@Op.1.%N) {}
  641. // CHECK:STDOUT:
  642. // CHECK:STDOUT: specific @Op.1(constants.%N) {
  643. // CHECK:STDOUT: %N => constants.%N
  644. // CHECK:STDOUT: %MyInt => constants.%MyInt.09f
  645. // CHECK:STDOUT:
  646. // CHECK:STDOUT: !definition:
  647. // CHECK:STDOUT: }
  648. // CHECK:STDOUT:
  649. // CHECK:STDOUT: specific @impl(constants.%int_64) {
  650. // CHECK:STDOUT: %N => constants.%int_64
  651. // CHECK:STDOUT: %N.patt => constants.%int_64
  652. // CHECK:STDOUT: %MyInt => constants.%MyInt.f30
  653. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.8d6
  654. // CHECK:STDOUT:
  655. // CHECK:STDOUT: !definition:
  656. // CHECK:STDOUT: %Op.type => constants.%Op.type.5a6
  657. // CHECK:STDOUT: %Op => constants.%Op.cf9
  658. // CHECK:STDOUT: %require_complete => constants.%complete_type.4a1
  659. // CHECK:STDOUT: }
  660. // CHECK:STDOUT:
  661. // CHECK:STDOUT: specific @Op.2(constants.%Self) {
  662. // CHECK:STDOUT: %Self => constants.%Self
  663. // CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
  664. // CHECK:STDOUT: }
  665. // CHECK:STDOUT:
  666. // CHECK:STDOUT: specific @Op.1(constants.%int_64) {
  667. // CHECK:STDOUT: %N => constants.%int_64
  668. // CHECK:STDOUT: %MyInt => constants.%MyInt.f30
  669. // CHECK:STDOUT:
  670. // CHECK:STDOUT: !definition:
  671. // CHECK:STDOUT: }
  672. // CHECK:STDOUT:
  673. // CHECK:STDOUT: specific @MyInt(@Double.%N) {}
  674. // CHECK:STDOUT:
  675. // CHECK:STDOUT: specific @Double(constants.%N) {
  676. // CHECK:STDOUT: %N => constants.%N
  677. // CHECK:STDOUT: %N.patt => constants.%N
  678. // CHECK:STDOUT: %MyInt => constants.%MyInt.09f
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT:
  681. // CHECK:STDOUT: specific @impl(@Double.%N) {}
  682. // CHECK:STDOUT:
  683. // CHECK:STDOUT: specific @Double(constants.%int_64) {
  684. // CHECK:STDOUT: %N => constants.%int_64
  685. // CHECK:STDOUT: %N.patt => constants.%int_64
  686. // CHECK:STDOUT: %MyInt => constants.%MyInt.f30
  687. // CHECK:STDOUT:
  688. // CHECK:STDOUT: !definition:
  689. // CHECK:STDOUT: %require_complete => constants.%complete_type.4a1
  690. // CHECK:STDOUT: %impl_witness => constants.%impl_witness.bb3
  691. // CHECK:STDOUT: %Add.facet => constants.%Add.facet.22c
  692. // CHECK:STDOUT: %.1 => constants.%.41c
  693. // CHECK:STDOUT: %Op.type => constants.%Op.type.5a6
  694. // CHECK:STDOUT: %Op => constants.%Op.cf9
  695. // CHECK:STDOUT: }
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: --- convert_symbolic.carbon
  698. // CHECK:STDOUT:
  699. // CHECK:STDOUT: constants {
  700. // CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template]
  701. // CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template]
  702. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  703. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  704. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  705. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
  706. // CHECK:STDOUT: %ToLiteral.type.e7c: type = fn_type @ToLiteral.1 [template]
  707. // CHECK:STDOUT: %ToLiteral.cf3: %ToLiteral.type.e7c = struct_value () [template]
  708. // CHECK:STDOUT: %FromLiteral.type: type = fn_type @FromLiteral [template]
  709. // CHECK:STDOUT: %FromLiteral: %FromLiteral.type = struct_value () [template]
  710. // CHECK:STDOUT: %N.987: %i32.builtin = bind_symbolic_name N, 0 [symbolic]
  711. // CHECK:STDOUT: %N.patt.36b: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic]
  712. // CHECK:STDOUT: %int.convert_checked.346: init Core.IntLiteral = call %ToLiteral.cf3(%N.987) [symbolic]
  713. // CHECK:STDOUT: %iN.builtin.016: type = int_type signed, %int.convert_checked.346 [symbolic]
  714. // CHECK:STDOUT: %Make.type: type = fn_type @Make [template]
  715. // CHECK:STDOUT: %Make: %Make.type = struct_value () [template]
  716. // CHECK:STDOUT: %require_complete.88f: <witness> = require_complete_type %iN.builtin.016 [symbolic]
  717. // CHECK:STDOUT: %Make.specific_fn: <specific function> = specific_function %Make, @Make(%N.987) [symbolic]
  718. // CHECK:STDOUT: %OtherInt: type = class_type @OtherInt [template]
  719. // CHECK:STDOUT: %ToLiteral.type.67d: type = fn_type @ToLiteral.2 [template]
  720. // CHECK:STDOUT: %ToLiteral.ec2: %ToLiteral.type.67d = struct_value () [template]
  721. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %i32.builtin [template]
  722. // CHECK:STDOUT: %N.335: %OtherInt = bind_symbolic_name N, 0 [symbolic]
  723. // CHECK:STDOUT: %N.patt.59d: %OtherInt = symbolic_binding_pattern N, 0 [symbolic]
  724. // CHECK:STDOUT: %ToLiteral.bound: <bound method> = bound_method %N.335, %ToLiteral.ec2 [symbolic]
  725. // CHECK:STDOUT: %int.convert_checked.b6b: init Core.IntLiteral = call %ToLiteral.bound(%N.335) [symbolic]
  726. // CHECK:STDOUT: %iN.builtin.9ef: type = int_type signed, %int.convert_checked.b6b [symbolic]
  727. // CHECK:STDOUT: %MakeFromClass.type: type = fn_type @MakeFromClass [template]
  728. // CHECK:STDOUT: %MakeFromClass: %MakeFromClass.type = struct_value () [template]
  729. // CHECK:STDOUT: %require_complete.c7d: <witness> = require_complete_type %iN.builtin.9ef [symbolic]
  730. // CHECK:STDOUT: %MakeFromClass.specific_fn: <specific function> = specific_function %MakeFromClass, @MakeFromClass(%N.335) [symbolic]
  731. // CHECK:STDOUT: }
  732. // CHECK:STDOUT:
  733. // CHECK:STDOUT: file {
  734. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  735. // CHECK:STDOUT: .IntLiteral = %IntLiteral.decl
  736. // CHECK:STDOUT: .Int = %Int.decl
  737. // CHECK:STDOUT: .ToLiteral = %ToLiteral.decl.loc6
  738. // CHECK:STDOUT: .FromLiteral = %FromLiteral.decl
  739. // CHECK:STDOUT: .Make = %Make.decl
  740. // CHECK:STDOUT: .OtherInt = %OtherInt.decl
  741. // CHECK:STDOUT: .MakeFromClass = %MakeFromClass.decl
  742. // CHECK:STDOUT: }
  743. // CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] {
  744. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  745. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0
  746. // CHECK:STDOUT: } {
  747. // CHECK:STDOUT: %return.param: ref type = out_param runtime_param0
  748. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  749. // CHECK:STDOUT: }
  750. // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] {
  751. // CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n
  752. // CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0
  753. // CHECK:STDOUT: %return.patt: type = return_slot_pattern
  754. // CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1
  755. // CHECK:STDOUT: } {
  756. // CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0
  757. // CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.3 [template = Core.IntLiteral] {
  758. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  759. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  760. // CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  761. // CHECK:STDOUT: %.loc5_22.3: type = converted %int_literal.make_type, %.loc5_22.2 [template = Core.IntLiteral]
  762. // CHECK:STDOUT: }
  763. // CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param
  764. // CHECK:STDOUT: %return.param: ref type = out_param runtime_param1
  765. // CHECK:STDOUT: %return: ref type = return_slot %return.param
  766. // CHECK:STDOUT: }
  767. // CHECK:STDOUT: %ToLiteral.decl.loc6: %ToLiteral.type.e7c = fn_decl @ToLiteral.1 [template = constants.%ToLiteral.cf3] {
  768. // CHECK:STDOUT: %n.patt: %i32.builtin = binding_pattern n
  769. // CHECK:STDOUT: %n.param_patt: %i32.builtin = value_param_pattern %n.patt, runtime_param0
  770. // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
  771. // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
  772. // CHECK:STDOUT: } {
  773. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  774. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  775. // CHECK:STDOUT: %.loc6_40.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  776. // CHECK:STDOUT: %.loc6_40.2: type = converted %int_literal.make_type, %.loc6_40.1 [template = Core.IntLiteral]
  777. // CHECK:STDOUT: %n.param: %i32.builtin = value_param runtime_param0
  778. // CHECK:STDOUT: %.loc6_23.1: type = splice_block %.loc6_23.3 [template = constants.%i32.builtin] {
  779. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int]
  780. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  781. // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin]
  782. // CHECK:STDOUT: %.loc6_23.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin]
  783. // CHECK:STDOUT: %.loc6_23.3: type = converted %int.make_type_signed, %.loc6_23.2 [template = constants.%i32.builtin]
  784. // CHECK:STDOUT: }
  785. // CHECK:STDOUT: %n: %i32.builtin = bind_name n, %n.param
  786. // CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1
  787. // CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param
  788. // CHECK:STDOUT: }
  789. // CHECK:STDOUT: %FromLiteral.decl: %FromLiteral.type = fn_decl @FromLiteral [template = constants.%FromLiteral] {
  790. // CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n
  791. // CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0
  792. // CHECK:STDOUT: %return.patt: %i32.builtin = return_slot_pattern
  793. // CHECK:STDOUT: %return.param_patt: %i32.builtin = out_param_pattern %return.patt, runtime_param1
  794. // CHECK:STDOUT: } {
  795. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int]
  796. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  797. // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin]
  798. // CHECK:STDOUT: %.loc7_42.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin]
  799. // CHECK:STDOUT: %.loc7_42.2: type = converted %int.make_type_signed, %.loc7_42.1 [template = constants.%i32.builtin]
  800. // CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0
  801. // CHECK:STDOUT: %.loc7_30.1: type = splice_block %.loc7_30.3 [template = Core.IntLiteral] {
  802. // CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  803. // CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral]
  804. // CHECK:STDOUT: %.loc7_30.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral]
  805. // CHECK:STDOUT: %.loc7_30.3: type = converted %int_literal.make_type, %.loc7_30.2 [template = Core.IntLiteral]
  806. // CHECK:STDOUT: }
  807. // CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param
  808. // CHECK:STDOUT: %return.param: ref %i32.builtin = out_param runtime_param1
  809. // CHECK:STDOUT: %return: ref %i32.builtin = return_slot %return.param
  810. // CHECK:STDOUT: }
  811. // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {
  812. // CHECK:STDOUT: %N.patt.loc9_9.1: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc9_9.2 (constants.%N.patt.36b)]
  813. // CHECK:STDOUT: %N.param_patt: %i32.builtin = value_param_pattern %N.patt.loc9_9.1, runtime_param<none> [symbolic = %N.patt.loc9_9.2 (constants.%N.patt.36b)]
  814. // CHECK:STDOUT: %return.patt: @Make.%iN.builtin (%iN.builtin.016) = return_slot_pattern
  815. // CHECK:STDOUT: %return.param_patt: @Make.%iN.builtin (%iN.builtin.016) = out_param_pattern %return.patt, runtime_param0
  816. // CHECK:STDOUT: } {
  817. // CHECK:STDOUT: %Int.ref.loc9_25: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int]
  818. // CHECK:STDOUT: %ToLiteral.ref: %ToLiteral.type.e7c = name_ref ToLiteral, file.%ToLiteral.decl.loc6 [template = constants.%ToLiteral.cf3]
  819. // CHECK:STDOUT: %N.ref.loc9_39: %i32.builtin = name_ref N, %N.loc9_9.1 [symbolic = %N.loc9_9.2 (constants.%N.987)]
  820. // CHECK:STDOUT: %int.convert_checked.loc9_40.1: init Core.IntLiteral = call %ToLiteral.ref(%N.ref.loc9_39) [symbolic = %int.convert_checked.loc9_40.2 (constants.%int.convert_checked.346)]
  821. // CHECK:STDOUT: %.loc9_40.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc9_40.1 [symbolic = %int.convert_checked.loc9_40.2 (constants.%int.convert_checked.346)]
  822. // CHECK:STDOUT: %.loc9_40.2: Core.IntLiteral = converted %int.convert_checked.loc9_40.1, %.loc9_40.1 [symbolic = %int.convert_checked.loc9_40.2 (constants.%int.convert_checked.346)]
  823. // CHECK:STDOUT: %int.make_type_signed.loc9_41: init type = call %Int.ref.loc9_25(%.loc9_40.2) [symbolic = %iN.builtin (constants.%iN.builtin.016)]
  824. // CHECK:STDOUT: %.loc9_41.1: type = value_of_initializer %int.make_type_signed.loc9_41 [symbolic = %iN.builtin (constants.%iN.builtin.016)]
  825. // CHECK:STDOUT: %.loc9_41.2: type = converted %int.make_type_signed.loc9_41, %.loc9_41.1 [symbolic = %iN.builtin (constants.%iN.builtin.016)]
  826. // CHECK:STDOUT: %N.param: %i32.builtin = value_param runtime_param<none>
  827. // CHECK:STDOUT: %.loc9_19.1: type = splice_block %.loc9_19.3 [template = constants.%i32.builtin] {
  828. // CHECK:STDOUT: %Int.ref.loc9_13: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int]
  829. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  830. // CHECK:STDOUT: %int.make_type_signed.loc9_19: init type = call %Int.ref.loc9_13(%int_32) [template = constants.%i32.builtin]
  831. // CHECK:STDOUT: %.loc9_19.2: type = value_of_initializer %int.make_type_signed.loc9_19 [template = constants.%i32.builtin]
  832. // CHECK:STDOUT: %.loc9_19.3: type = converted %int.make_type_signed.loc9_19, %.loc9_19.2 [template = constants.%i32.builtin]
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT: %N.loc9_9.1: %i32.builtin = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc9_9.2 (constants.%N.987)]
  835. // CHECK:STDOUT: %return.param: ref @Make.%iN.builtin (%iN.builtin.016) = out_param runtime_param0
  836. // CHECK:STDOUT: %return: ref @Make.%iN.builtin (%iN.builtin.016) = return_slot %return.param
  837. // CHECK:STDOUT: }
  838. // CHECK:STDOUT: %OtherInt.decl: type = class_decl @OtherInt [template = constants.%OtherInt] {} {}
  839. // CHECK:STDOUT: %ToLiteral.decl.loc16: %ToLiteral.type.67d = fn_decl @ToLiteral.2 [template = constants.%ToLiteral.ec2] {
  840. // CHECK:STDOUT: %self.patt: %OtherInt = binding_pattern self
  841. // CHECK:STDOUT: %self.param_patt: %OtherInt = value_param_pattern %self.patt, runtime_param0
  842. // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
  843. // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
  844. // CHECK:STDOUT: } {
  845. // CHECK:STDOUT: %IntLiteral.ref.loc16: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  846. // CHECK:STDOUT: %int_literal.make_type.loc16: init type = call %IntLiteral.ref.loc16() [template = Core.IntLiteral]
  847. // CHECK:STDOUT: %.loc16_51.1: type = value_of_initializer %int_literal.make_type.loc16 [template = Core.IntLiteral]
  848. // CHECK:STDOUT: %.loc16_51.2: type = converted %int_literal.make_type.loc16, %.loc16_51.1 [template = Core.IntLiteral]
  849. // CHECK:STDOUT: %self.param.loc16: %OtherInt = value_param runtime_param0
  850. // CHECK:STDOUT: %Self.ref.loc16: type = name_ref Self, constants.%OtherInt [template = constants.%OtherInt]
  851. // CHECK:STDOUT: %self.loc16: %OtherInt = bind_name self, %self.param.loc16
  852. // CHECK:STDOUT: %return.param.loc16: ref Core.IntLiteral = out_param runtime_param1
  853. // CHECK:STDOUT: %return.loc16: ref Core.IntLiteral = return_slot %return.param.loc16
  854. // CHECK:STDOUT: }
  855. // CHECK:STDOUT: %MakeFromClass.decl: %MakeFromClass.type = fn_decl @MakeFromClass [template = constants.%MakeFromClass] {
  856. // CHECK:STDOUT: %N.patt.loc18_18.1: %OtherInt = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc18_18.2 (constants.%N.patt.59d)]
  857. // CHECK:STDOUT: %N.param_patt: %OtherInt = value_param_pattern %N.patt.loc18_18.1, runtime_param<none> [symbolic = %N.patt.loc18_18.2 (constants.%N.patt.59d)]
  858. // CHECK:STDOUT: %return.patt: @MakeFromClass.%iN.builtin (%iN.builtin.9ef) = return_slot_pattern
  859. // CHECK:STDOUT: %return.param_patt: @MakeFromClass.%iN.builtin (%iN.builtin.9ef) = out_param_pattern %return.patt, runtime_param0
  860. // CHECK:STDOUT: } {
  861. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int]
  862. // CHECK:STDOUT: %N.ref.loc18_39: %OtherInt = name_ref N, %N.loc18_18.1 [symbolic = %N.loc18_18.2 (constants.%N.335)]
  863. // CHECK:STDOUT: %ToLiteral.ref: %ToLiteral.type.67d = name_ref ToLiteral, @OtherInt.%ToLiteral.decl [template = constants.%ToLiteral.ec2]
  864. // CHECK:STDOUT: %ToLiteral.bound.loc18_40.1: <bound method> = bound_method %N.ref.loc18_39, %ToLiteral.ref [symbolic = %ToLiteral.bound.loc18_40.2 (constants.%ToLiteral.bound)]
  865. // CHECK:STDOUT: %int.convert_checked.loc18_51.1: init Core.IntLiteral = call %ToLiteral.bound.loc18_40.1(%N.ref.loc18_39) [symbolic = %int.convert_checked.loc18_51.2 (constants.%int.convert_checked.b6b)]
  866. // CHECK:STDOUT: %.loc18_51.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc18_51.1 [symbolic = %int.convert_checked.loc18_51.2 (constants.%int.convert_checked.b6b)]
  867. // CHECK:STDOUT: %.loc18_51.2: Core.IntLiteral = converted %int.convert_checked.loc18_51.1, %.loc18_51.1 [symbolic = %int.convert_checked.loc18_51.2 (constants.%int.convert_checked.b6b)]
  868. // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc18_51.2) [symbolic = %iN.builtin (constants.%iN.builtin.9ef)]
  869. // CHECK:STDOUT: %.loc18_52.1: type = value_of_initializer %int.make_type_signed [symbolic = %iN.builtin (constants.%iN.builtin.9ef)]
  870. // CHECK:STDOUT: %.loc18_52.2: type = converted %int.make_type_signed, %.loc18_52.1 [symbolic = %iN.builtin (constants.%iN.builtin.9ef)]
  871. // CHECK:STDOUT: %N.param: %OtherInt = value_param runtime_param<none>
  872. // CHECK:STDOUT: %OtherInt.ref: type = name_ref OtherInt, file.%OtherInt.decl [template = constants.%OtherInt]
  873. // CHECK:STDOUT: %N.loc18_18.1: %OtherInt = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc18_18.2 (constants.%N.335)]
  874. // CHECK:STDOUT: %return.param: ref @MakeFromClass.%iN.builtin (%iN.builtin.9ef) = out_param runtime_param0
  875. // CHECK:STDOUT: %return: ref @MakeFromClass.%iN.builtin (%iN.builtin.9ef) = return_slot %return.param
  876. // CHECK:STDOUT: }
  877. // CHECK:STDOUT: }
  878. // CHECK:STDOUT:
  879. // CHECK:STDOUT: class @OtherInt {
  880. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, file.%Int.decl [template = constants.%Int]
  881. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  882. // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%int_32) [template = constants.%i32.builtin]
  883. // CHECK:STDOUT: %.loc12_16.1: type = value_of_initializer %int.make_type_signed [template = constants.%i32.builtin]
  884. // CHECK:STDOUT: %.loc12_16.2: type = converted %int.make_type_signed, %.loc12_16.1 [template = constants.%i32.builtin]
  885. // CHECK:STDOUT: adapt_decl %.loc12_16.2 [template]
  886. // CHECK:STDOUT: %ToLiteral.decl: %ToLiteral.type.67d = fn_decl @ToLiteral.2 [template = constants.%ToLiteral.ec2] {
  887. // CHECK:STDOUT: %self.patt: %OtherInt = binding_pattern self
  888. // CHECK:STDOUT: %self.param_patt: %OtherInt = value_param_pattern %self.patt, runtime_param0
  889. // CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern
  890. // CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1
  891. // CHECK:STDOUT: } {
  892. // CHECK:STDOUT: %IntLiteral.ref.loc13: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral]
  893. // CHECK:STDOUT: %int_literal.make_type.loc13: init type = call %IntLiteral.ref.loc13() [template = Core.IntLiteral]
  894. // CHECK:STDOUT: %.loc13_44.1: type = value_of_initializer %int_literal.make_type.loc13 [template = Core.IntLiteral]
  895. // CHECK:STDOUT: %.loc13_44.2: type = converted %int_literal.make_type.loc13, %.loc13_44.1 [template = Core.IntLiteral]
  896. // CHECK:STDOUT: %self.param.loc13: %OtherInt = value_param runtime_param0
  897. // CHECK:STDOUT: %Self.ref.loc13: type = name_ref Self, constants.%OtherInt [template = constants.%OtherInt]
  898. // CHECK:STDOUT: %self.loc13: %OtherInt = bind_name self, %self.param.loc13
  899. // CHECK:STDOUT: %return.param.loc13: ref Core.IntLiteral = out_param runtime_param1
  900. // CHECK:STDOUT: %return.loc13: ref Core.IntLiteral = return_slot %return.param.loc13
  901. // CHECK:STDOUT: }
  902. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %i32.builtin [template = constants.%complete_type]
  903. // CHECK:STDOUT: complete_type_witness = %complete_type
  904. // CHECK:STDOUT:
  905. // CHECK:STDOUT: !members:
  906. // CHECK:STDOUT: .Self = constants.%OtherInt
  907. // CHECK:STDOUT: .ToLiteral = %ToLiteral.decl
  908. // CHECK:STDOUT: }
  909. // CHECK:STDOUT:
  910. // CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type";
  911. // CHECK:STDOUT:
  912. // CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed";
  913. // CHECK:STDOUT:
  914. // CHECK:STDOUT: fn @ToLiteral.1(%n.param_patt: %i32.builtin) -> Core.IntLiteral = "int.convert_checked";
  915. // CHECK:STDOUT:
  916. // CHECK:STDOUT: fn @FromLiteral(%n.param_patt: Core.IntLiteral) -> %i32.builtin = "int.convert_checked";
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: generic fn @Make(%N.loc9_9.1: %i32.builtin) {
  919. // CHECK:STDOUT: %N.loc9_9.2: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N.loc9_9.2 (constants.%N.987)]
  920. // CHECK:STDOUT: %N.patt.loc9_9.2: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc9_9.2 (constants.%N.patt.36b)]
  921. // CHECK:STDOUT: %int.convert_checked.loc9_40.2: init Core.IntLiteral = call constants.%ToLiteral.cf3(%N.loc9_9.2) [symbolic = %int.convert_checked.loc9_40.2 (constants.%int.convert_checked.346)]
  922. // CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked.loc9_40.2 [symbolic = %iN.builtin (constants.%iN.builtin.016)]
  923. // CHECK:STDOUT:
  924. // CHECK:STDOUT: !definition:
  925. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Make.%iN.builtin (%iN.builtin.016) [symbolic = %require_complete (constants.%require_complete.88f)]
  926. // CHECK:STDOUT: %Make.specific_fn.loc9_52.2: <specific function> = specific_function constants.%Make, @Make(%N.loc9_9.2) [symbolic = %Make.specific_fn.loc9_52.2 (constants.%Make.specific_fn)]
  927. // CHECK:STDOUT:
  928. // CHECK:STDOUT: fn(%N.param_patt: %i32.builtin) -> @Make.%iN.builtin (%iN.builtin.016) {
  929. // CHECK:STDOUT: !entry:
  930. // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, file.%Make.decl [template = constants.%Make]
  931. // CHECK:STDOUT: %N.ref.loc9_57: %i32.builtin = name_ref N, %N.loc9_9.1 [symbolic = %N.loc9_9.2 (constants.%N.987)]
  932. // CHECK:STDOUT: %Make.specific_fn.loc9_52.1: <specific function> = specific_function %Make.ref, @Make(constants.%N.987) [symbolic = %Make.specific_fn.loc9_52.2 (constants.%Make.specific_fn)]
  933. // CHECK:STDOUT: %Make.call: init @Make.%iN.builtin (%iN.builtin.016) = call %Make.specific_fn.loc9_52.1()
  934. // CHECK:STDOUT: %.loc9_59.1: @Make.%iN.builtin (%iN.builtin.016) = value_of_initializer %Make.call
  935. // CHECK:STDOUT: %.loc9_59.2: @Make.%iN.builtin (%iN.builtin.016) = converted %Make.call, %.loc9_59.1
  936. // CHECK:STDOUT: return %.loc9_59.2
  937. // CHECK:STDOUT: }
  938. // CHECK:STDOUT: }
  939. // CHECK:STDOUT:
  940. // CHECK:STDOUT: fn @ToLiteral.2[%self.param_patt: %OtherInt]() -> Core.IntLiteral = "int.convert_checked";
  941. // CHECK:STDOUT:
  942. // CHECK:STDOUT: generic fn @MakeFromClass(%N.loc18_18.1: %OtherInt) {
  943. // CHECK:STDOUT: %N.loc18_18.2: %OtherInt = bind_symbolic_name N, 0 [symbolic = %N.loc18_18.2 (constants.%N.335)]
  944. // CHECK:STDOUT: %N.patt.loc18_18.2: %OtherInt = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc18_18.2 (constants.%N.patt.59d)]
  945. // CHECK:STDOUT: %ToLiteral.bound.loc18_40.2: <bound method> = bound_method %N.loc18_18.2, constants.%ToLiteral.ec2 [symbolic = %ToLiteral.bound.loc18_40.2 (constants.%ToLiteral.bound)]
  946. // CHECK:STDOUT: %int.convert_checked.loc18_51.2: init Core.IntLiteral = call %ToLiteral.bound.loc18_40.2(%N.loc18_18.2) [symbolic = %int.convert_checked.loc18_51.2 (constants.%int.convert_checked.b6b)]
  947. // CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked.loc18_51.2 [symbolic = %iN.builtin (constants.%iN.builtin.9ef)]
  948. // CHECK:STDOUT:
  949. // CHECK:STDOUT: !definition:
  950. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @MakeFromClass.%iN.builtin (%iN.builtin.9ef) [symbolic = %require_complete (constants.%require_complete.c7d)]
  951. // CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.2: <specific function> = specific_function constants.%MakeFromClass, @MakeFromClass(%N.loc18_18.2) [symbolic = %MakeFromClass.specific_fn.loc18_63.2 (constants.%MakeFromClass.specific_fn)]
  952. // CHECK:STDOUT:
  953. // CHECK:STDOUT: fn(%N.param_patt: %OtherInt) -> @MakeFromClass.%iN.builtin (%iN.builtin.9ef) {
  954. // CHECK:STDOUT: !entry:
  955. // CHECK:STDOUT: %MakeFromClass.ref: %MakeFromClass.type = name_ref MakeFromClass, file.%MakeFromClass.decl [template = constants.%MakeFromClass]
  956. // CHECK:STDOUT: %N.ref.loc18_77: %OtherInt = name_ref N, %N.loc18_18.1 [symbolic = %N.loc18_18.2 (constants.%N.335)]
  957. // CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.1: <specific function> = specific_function %MakeFromClass.ref, @MakeFromClass(constants.%N.335) [symbolic = %MakeFromClass.specific_fn.loc18_63.2 (constants.%MakeFromClass.specific_fn)]
  958. // CHECK:STDOUT: %MakeFromClass.call: init @MakeFromClass.%iN.builtin (%iN.builtin.9ef) = call %MakeFromClass.specific_fn.loc18_63.1()
  959. // CHECK:STDOUT: %.loc18_79.1: @MakeFromClass.%iN.builtin (%iN.builtin.9ef) = value_of_initializer %MakeFromClass.call
  960. // CHECK:STDOUT: %.loc18_79.2: @MakeFromClass.%iN.builtin (%iN.builtin.9ef) = converted %MakeFromClass.call, %.loc18_79.1
  961. // CHECK:STDOUT: return %.loc18_79.2
  962. // CHECK:STDOUT: }
  963. // CHECK:STDOUT: }
  964. // CHECK:STDOUT:
  965. // CHECK:STDOUT: specific @Make(constants.%N.987) {
  966. // CHECK:STDOUT: %N.loc9_9.2 => constants.%N.987
  967. // CHECK:STDOUT: %N.patt.loc9_9.2 => constants.%N.987
  968. // CHECK:STDOUT: %int.convert_checked.loc9_40.2 => constants.%int.convert_checked.346
  969. // CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.016
  970. // CHECK:STDOUT:
  971. // CHECK:STDOUT: !definition:
  972. // CHECK:STDOUT: %require_complete => constants.%require_complete.88f
  973. // CHECK:STDOUT: %Make.specific_fn.loc9_52.2 => constants.%Make.specific_fn
  974. // CHECK:STDOUT: }
  975. // CHECK:STDOUT:
  976. // CHECK:STDOUT: specific @Make(%N.loc9_9.2) {}
  977. // CHECK:STDOUT:
  978. // CHECK:STDOUT: specific @MakeFromClass(constants.%N.335) {
  979. // CHECK:STDOUT: %N.loc18_18.2 => constants.%N.335
  980. // CHECK:STDOUT: %N.patt.loc18_18.2 => constants.%N.335
  981. // CHECK:STDOUT: %ToLiteral.bound.loc18_40.2 => constants.%ToLiteral.bound
  982. // CHECK:STDOUT: %int.convert_checked.loc18_51.2 => constants.%int.convert_checked.b6b
  983. // CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.9ef
  984. // CHECK:STDOUT:
  985. // CHECK:STDOUT: !definition:
  986. // CHECK:STDOUT: %require_complete => constants.%require_complete.c7d
  987. // CHECK:STDOUT: %MakeFromClass.specific_fn.loc18_63.2 => constants.%MakeFromClass.specific_fn
  988. // CHECK:STDOUT: }
  989. // CHECK:STDOUT:
  990. // CHECK:STDOUT: specific @MakeFromClass(%N.loc18_18.2) {}
  991. // CHECK:STDOUT:
  992. // CHECK:STDOUT: --- use_convert_symbolic.carbon
  993. // CHECK:STDOUT:
  994. // CHECK:STDOUT: constants {
  995. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  996. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  997. // CHECK:STDOUT: %int_64.fab: Core.IntLiteral = int_value 64 [template]
  998. // CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64.fab [template]
  999. // CHECK:STDOUT: %Make.type: type = fn_type @Make [template]
  1000. // CHECK:STDOUT: %Make: %Make.type = struct_value () [template]
  1001. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  1002. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
  1003. // CHECK:STDOUT: %N.patt.36b: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic]
  1004. // CHECK:STDOUT: %N.987: %i32.builtin = bind_symbolic_name N, 0 [symbolic]
  1005. // CHECK:STDOUT: %ToLiteral.type.e7c: type = fn_type @ToLiteral.1 [template]
  1006. // CHECK:STDOUT: %ToLiteral.cf3: %ToLiteral.type.e7c = struct_value () [template]
  1007. // CHECK:STDOUT: %int.convert_checked.346: init Core.IntLiteral = call %ToLiteral.cf3(%N.987) [symbolic]
  1008. // CHECK:STDOUT: %iN.builtin.016: type = int_type signed, %int.convert_checked.346 [symbolic]
  1009. // CHECK:STDOUT: %require_complete.88f: <witness> = require_complete_type %iN.builtin.016 [symbolic]
  1010. // CHECK:STDOUT: %Make.specific_fn.8ec: <specific function> = specific_function %Make, @Make(%N.987) [symbolic]
  1011. // CHECK:STDOUT: %FromLiteral.type: type = fn_type @FromLiteral [template]
  1012. // CHECK:STDOUT: %FromLiteral: %FromLiteral.type = struct_value () [template]
  1013. // CHECK:STDOUT: %int_64.f82: %i32.builtin = int_value 64 [template]
  1014. // CHECK:STDOUT: %Make.specific_fn.02d: <specific function> = specific_function %Make, @Make(%int_64.f82) [template]
  1015. // CHECK:STDOUT: %MakeFromClass.type: type = fn_type @MakeFromClass [template]
  1016. // CHECK:STDOUT: %MakeFromClass: %MakeFromClass.type = struct_value () [template]
  1017. // CHECK:STDOUT: %OtherInt: type = class_type @OtherInt [template]
  1018. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
  1019. // CHECK:STDOUT: %N.patt.59d: %OtherInt = symbolic_binding_pattern N, 0 [symbolic]
  1020. // CHECK:STDOUT: %N.335: %OtherInt = bind_symbolic_name N, 0 [symbolic]
  1021. // CHECK:STDOUT: %ToLiteral.type.67d: type = fn_type @ToLiteral.2 [template]
  1022. // CHECK:STDOUT: %ToLiteral.ec2: %ToLiteral.type.67d = struct_value () [template]
  1023. // CHECK:STDOUT: %ToLiteral.bound.8e3: <bound method> = bound_method %N.335, %ToLiteral.ec2 [symbolic]
  1024. // CHECK:STDOUT: %int.convert_checked.b6b: init Core.IntLiteral = call %ToLiteral.bound.8e3(%N.335) [symbolic]
  1025. // CHECK:STDOUT: %iN.builtin.9ef: type = int_type signed, %int.convert_checked.b6b [symbolic]
  1026. // CHECK:STDOUT: %require_complete.c7d: <witness> = require_complete_type %iN.builtin.9ef [symbolic]
  1027. // CHECK:STDOUT: %MakeFromClass.specific_fn.004: <specific function> = specific_function %MakeFromClass, @MakeFromClass(%N.335) [symbolic]
  1028. // CHECK:STDOUT: %int_64.06b: %OtherInt = int_value 64 [template]
  1029. // CHECK:STDOUT: %ToLiteral.bound.735: <bound method> = bound_method %int_64.06b, %ToLiteral.ec2 [template]
  1030. // CHECK:STDOUT: %MakeFromClass.specific_fn.61b: <specific function> = specific_function %MakeFromClass, @MakeFromClass(%int_64.06b) [template]
  1031. // CHECK:STDOUT: %complete_type.4a1: <witness> = complete_type_witness %i64.builtin [template]
  1032. // CHECK:STDOUT: }
  1033. // CHECK:STDOUT:
  1034. // CHECK:STDOUT: imports {
  1035. // CHECK:STDOUT: %Main.IntLiteral = import_ref Main//convert_symbolic, IntLiteral, unloaded
  1036. // CHECK:STDOUT: %Main.Int: %Int.type = import_ref Main//convert_symbolic, Int, loaded [template = constants.%Int]
  1037. // CHECK:STDOUT: %Main.ToLiteral = import_ref Main//convert_symbolic, ToLiteral, unloaded
  1038. // CHECK:STDOUT: %Main.FromLiteral: %FromLiteral.type = import_ref Main//convert_symbolic, FromLiteral, loaded [template = constants.%FromLiteral]
  1039. // CHECK:STDOUT: %Main.Make: %Make.type = import_ref Main//convert_symbolic, Make, loaded [template = constants.%Make]
  1040. // CHECK:STDOUT: %Main.OtherInt: type = import_ref Main//convert_symbolic, OtherInt, loaded [template = constants.%OtherInt]
  1041. // CHECK:STDOUT: %Main.MakeFromClass: %MakeFromClass.type = import_ref Main//convert_symbolic, MakeFromClass, loaded [template = constants.%MakeFromClass]
  1042. // CHECK:STDOUT: %Main.import_ref.512: %i32.builtin = import_ref Main//convert_symbolic, loc9_9, loaded [symbolic = @Make.%N (constants.%N.987)]
  1043. // CHECK:STDOUT: %Main.import_ref.b03: <witness> = import_ref Main//convert_symbolic, loc14_1, loaded [template = constants.%complete_type.f8a]
  1044. // CHECK:STDOUT: %Main.import_ref.d11 = import_ref Main//convert_symbolic, inst129 [no loc], unloaded
  1045. // CHECK:STDOUT: %Main.import_ref.8f7 = import_ref Main//convert_symbolic, loc13_45, unloaded
  1046. // CHECK:STDOUT: %Main.import_ref.b3c: %OtherInt = import_ref Main//convert_symbolic, loc18_18, loaded [symbolic = @MakeFromClass.%N (constants.%N.335)]
  1047. // CHECK:STDOUT: }
  1048. // CHECK:STDOUT:
  1049. // CHECK:STDOUT: file {
  1050. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1051. // CHECK:STDOUT: .IntLiteral = imports.%Main.IntLiteral
  1052. // CHECK:STDOUT: .Int = imports.%Main.Int
  1053. // CHECK:STDOUT: .ToLiteral = imports.%Main.ToLiteral
  1054. // CHECK:STDOUT: .FromLiteral = imports.%Main.FromLiteral
  1055. // CHECK:STDOUT: .Make = imports.%Main.Make
  1056. // CHECK:STDOUT: .OtherInt = imports.%Main.OtherInt
  1057. // CHECK:STDOUT: .MakeFromClass = imports.%Main.MakeFromClass
  1058. // CHECK:STDOUT: .m = %m
  1059. // CHECK:STDOUT: .n = %n
  1060. // CHECK:STDOUT: }
  1061. // CHECK:STDOUT: %default.import = import <none>
  1062. // CHECK:STDOUT: name_binding_decl {
  1063. // CHECK:STDOUT: %m.patt: %i64.builtin = binding_pattern m
  1064. // CHECK:STDOUT: %.loc6_1: %i64.builtin = var_pattern %m.patt
  1065. // CHECK:STDOUT: }
  1066. // CHECK:STDOUT: %m.var: ref %i64.builtin = var m
  1067. // CHECK:STDOUT: %.loc6_14.1: type = splice_block %.loc6_14.3 [template = constants.%i64.builtin] {
  1068. // CHECK:STDOUT: %Int.ref.loc6: %Int.type = name_ref Int, imports.%Main.Int [template = constants.%Int]
  1069. // CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64.fab]
  1070. // CHECK:STDOUT: %int.make_type_signed.loc6: init type = call %Int.ref.loc6(%int_64.loc6) [template = constants.%i64.builtin]
  1071. // CHECK:STDOUT: %.loc6_14.2: type = value_of_initializer %int.make_type_signed.loc6 [template = constants.%i64.builtin]
  1072. // CHECK:STDOUT: %.loc6_14.3: type = converted %int.make_type_signed.loc6, %.loc6_14.2 [template = constants.%i64.builtin]
  1073. // CHECK:STDOUT: }
  1074. // CHECK:STDOUT: %m: ref %i64.builtin = bind_name m, %m.var
  1075. // CHECK:STDOUT: name_binding_decl {
  1076. // CHECK:STDOUT: %n.patt: %i64.builtin = binding_pattern n
  1077. // CHECK:STDOUT: %.loc7_1: %i64.builtin = var_pattern %n.patt
  1078. // CHECK:STDOUT: }
  1079. // CHECK:STDOUT: %n.var: ref %i64.builtin = var n
  1080. // CHECK:STDOUT: %.loc7_14.1: type = splice_block %.loc7_14.3 [template = constants.%i64.builtin] {
  1081. // CHECK:STDOUT: %Int.ref.loc7: %Int.type = name_ref Int, imports.%Main.Int [template = constants.%Int]
  1082. // CHECK:STDOUT: %int_64.loc7: Core.IntLiteral = int_value 64 [template = constants.%int_64.fab]
  1083. // CHECK:STDOUT: %int.make_type_signed.loc7: init type = call %Int.ref.loc7(%int_64.loc7) [template = constants.%i64.builtin]
  1084. // CHECK:STDOUT: %.loc7_14.2: type = value_of_initializer %int.make_type_signed.loc7 [template = constants.%i64.builtin]
  1085. // CHECK:STDOUT: %.loc7_14.3: type = converted %int.make_type_signed.loc7, %.loc7_14.2 [template = constants.%i64.builtin]
  1086. // CHECK:STDOUT: }
  1087. // CHECK:STDOUT: %n: ref %i64.builtin = bind_name n, %n.var
  1088. // CHECK:STDOUT: }
  1089. // CHECK:STDOUT:
  1090. // CHECK:STDOUT: class @OtherInt [from "convert_symbolic.carbon"] {
  1091. // CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.b03
  1092. // CHECK:STDOUT:
  1093. // CHECK:STDOUT: !members:
  1094. // CHECK:STDOUT: .Self = imports.%Main.import_ref.d11
  1095. // CHECK:STDOUT: .ToLiteral = imports.%Main.import_ref.8f7
  1096. // CHECK:STDOUT: }
  1097. // CHECK:STDOUT:
  1098. // CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "convert_symbolic.carbon"];
  1099. // CHECK:STDOUT:
  1100. // CHECK:STDOUT: generic fn @Make(imports.%Main.import_ref.512: %i32.builtin) [from "convert_symbolic.carbon"] {
  1101. // CHECK:STDOUT: %N: %i32.builtin = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.987)]
  1102. // CHECK:STDOUT: %N.patt: %i32.builtin = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.36b)]
  1103. // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call constants.%ToLiteral.cf3(%N) [symbolic = %int.convert_checked (constants.%int.convert_checked.346)]
  1104. // CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked [symbolic = %iN.builtin (constants.%iN.builtin.016)]
  1105. // CHECK:STDOUT:
  1106. // CHECK:STDOUT: !definition:
  1107. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @Make.%iN.builtin (%iN.builtin.016) [symbolic = %require_complete (constants.%require_complete.88f)]
  1108. // CHECK:STDOUT: %Make.specific_fn: <specific function> = specific_function constants.%Make, @Make(%N) [symbolic = %Make.specific_fn (constants.%Make.specific_fn.8ec)]
  1109. // CHECK:STDOUT:
  1110. // CHECK:STDOUT: fn(%N.param_patt: %i32.builtin) -> @Make.%iN.builtin (%iN.builtin.016);
  1111. // CHECK:STDOUT: }
  1112. // CHECK:STDOUT:
  1113. // CHECK:STDOUT: fn @ToLiteral.1(%n.param_patt: %i32.builtin) -> Core.IntLiteral = "int.convert_checked" [from "convert_symbolic.carbon"];
  1114. // CHECK:STDOUT:
  1115. // CHECK:STDOUT: fn @FromLiteral(%n.param_patt: Core.IntLiteral) -> %i32.builtin = "int.convert_checked" [from "convert_symbolic.carbon"];
  1116. // CHECK:STDOUT:
  1117. // CHECK:STDOUT: generic fn @MakeFromClass(imports.%Main.import_ref.b3c: %OtherInt) [from "convert_symbolic.carbon"] {
  1118. // CHECK:STDOUT: %N: %OtherInt = bind_symbolic_name N, 0 [symbolic = %N (constants.%N.335)]
  1119. // CHECK:STDOUT: %N.patt: %OtherInt = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt.59d)]
  1120. // CHECK:STDOUT: %ToLiteral.bound: <bound method> = bound_method %N, constants.%ToLiteral.ec2 [symbolic = %ToLiteral.bound (constants.%ToLiteral.bound.8e3)]
  1121. // CHECK:STDOUT: %int.convert_checked: init Core.IntLiteral = call %ToLiteral.bound(%N) [symbolic = %int.convert_checked (constants.%int.convert_checked.b6b)]
  1122. // CHECK:STDOUT: %iN.builtin: type = int_type signed, %int.convert_checked [symbolic = %iN.builtin (constants.%iN.builtin.9ef)]
  1123. // CHECK:STDOUT:
  1124. // CHECK:STDOUT: !definition:
  1125. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @MakeFromClass.%iN.builtin (%iN.builtin.9ef) [symbolic = %require_complete (constants.%require_complete.c7d)]
  1126. // CHECK:STDOUT: %MakeFromClass.specific_fn: <specific function> = specific_function constants.%MakeFromClass, @MakeFromClass(%N) [symbolic = %MakeFromClass.specific_fn (constants.%MakeFromClass.specific_fn.004)]
  1127. // CHECK:STDOUT:
  1128. // CHECK:STDOUT: fn(%N.param_patt: %OtherInt) -> @MakeFromClass.%iN.builtin (%iN.builtin.9ef);
  1129. // CHECK:STDOUT: }
  1130. // CHECK:STDOUT:
  1131. // CHECK:STDOUT: fn @ToLiteral.2[%self.param_patt: %OtherInt]() -> Core.IntLiteral = "int.convert_checked" [from "convert_symbolic.carbon"];
  1132. // CHECK:STDOUT:
  1133. // CHECK:STDOUT: fn @__global_init() {
  1134. // CHECK:STDOUT: !entry:
  1135. // CHECK:STDOUT: %Make.ref: %Make.type = name_ref Make, imports.%Main.Make [template = constants.%Make]
  1136. // CHECK:STDOUT: %FromLiteral.ref.loc6: %FromLiteral.type = name_ref FromLiteral, imports.%Main.FromLiteral [template = constants.%FromLiteral]
  1137. // CHECK:STDOUT: %int_64.loc6: Core.IntLiteral = int_value 64 [template = constants.%int_64.fab]
  1138. // CHECK:STDOUT: %int.convert_checked.loc6: init %i32.builtin = call %FromLiteral.ref.loc6(%int_64.loc6) [template = constants.%int_64.f82]
  1139. // CHECK:STDOUT: %.loc6_38.1: %i32.builtin = value_of_initializer %int.convert_checked.loc6 [template = constants.%int_64.f82]
  1140. // CHECK:STDOUT: %.loc6_38.2: %i32.builtin = converted %int.convert_checked.loc6, %.loc6_38.1 [template = constants.%int_64.f82]
  1141. // CHECK:STDOUT: %Make.specific_fn: <specific function> = specific_function %Make.ref, @Make(constants.%int_64.f82) [template = constants.%Make.specific_fn.02d]
  1142. // CHECK:STDOUT: %Make.call: init %i64.builtin = call %Make.specific_fn()
  1143. // CHECK:STDOUT: assign file.%m.var, %Make.call
  1144. // CHECK:STDOUT: %MakeFromClass.ref: %MakeFromClass.type = name_ref MakeFromClass, imports.%Main.MakeFromClass [template = constants.%MakeFromClass]
  1145. // CHECK:STDOUT: %FromLiteral.ref.loc7: %FromLiteral.type = name_ref FromLiteral, imports.%Main.FromLiteral [template = constants.%FromLiteral]
  1146. // CHECK:STDOUT: %int_64.loc7: Core.IntLiteral = int_value 64 [template = constants.%int_64.fab]
  1147. // CHECK:STDOUT: %int.convert_checked.loc7: init %i32.builtin = call %FromLiteral.ref.loc7(%int_64.loc7) [template = constants.%int_64.f82]
  1148. // CHECK:STDOUT: %OtherInt.ref: type = name_ref OtherInt, imports.%Main.OtherInt [template = constants.%OtherInt]
  1149. // CHECK:STDOUT: %.loc7_48.1: init %OtherInt = as_compatible %int.convert_checked.loc7 [template = constants.%int_64.06b]
  1150. // CHECK:STDOUT: %.loc7_48.2: init %OtherInt = converted %int.convert_checked.loc7, %.loc7_48.1 [template = constants.%int_64.06b]
  1151. // CHECK:STDOUT: %.loc7_59.1: %OtherInt = value_of_initializer %.loc7_48.2 [template = constants.%int_64.06b]
  1152. // CHECK:STDOUT: %.loc7_59.2: %OtherInt = converted %.loc7_48.2, %.loc7_59.1 [template = constants.%int_64.06b]
  1153. // CHECK:STDOUT: %MakeFromClass.specific_fn: <specific function> = specific_function %MakeFromClass.ref, @MakeFromClass(constants.%int_64.06b) [template = constants.%MakeFromClass.specific_fn.61b]
  1154. // CHECK:STDOUT: %MakeFromClass.call: init %i64.builtin = call %MakeFromClass.specific_fn()
  1155. // CHECK:STDOUT: assign file.%n.var, %MakeFromClass.call
  1156. // CHECK:STDOUT: return
  1157. // CHECK:STDOUT: }
  1158. // CHECK:STDOUT:
  1159. // CHECK:STDOUT: specific @Make(constants.%N.987) {
  1160. // CHECK:STDOUT: %N => constants.%N.987
  1161. // CHECK:STDOUT: %N.patt => constants.%N.987
  1162. // CHECK:STDOUT: %int.convert_checked => constants.%int.convert_checked.346
  1163. // CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.016
  1164. // CHECK:STDOUT:
  1165. // CHECK:STDOUT: !definition:
  1166. // CHECK:STDOUT: %require_complete => constants.%require_complete.88f
  1167. // CHECK:STDOUT: %Make.specific_fn => constants.%Make.specific_fn.8ec
  1168. // CHECK:STDOUT: }
  1169. // CHECK:STDOUT:
  1170. // CHECK:STDOUT: specific @Make(%N) {}
  1171. // CHECK:STDOUT:
  1172. // CHECK:STDOUT: specific @Make(constants.%int_64.f82) {
  1173. // CHECK:STDOUT: %N => constants.%int_64.f82
  1174. // CHECK:STDOUT: %N.patt => constants.%int_64.f82
  1175. // CHECK:STDOUT: %int.convert_checked => constants.%int_64.fab
  1176. // CHECK:STDOUT: %iN.builtin => constants.%i64.builtin
  1177. // CHECK:STDOUT:
  1178. // CHECK:STDOUT: !definition:
  1179. // CHECK:STDOUT: %require_complete => constants.%complete_type.4a1
  1180. // CHECK:STDOUT: %Make.specific_fn => constants.%Make.specific_fn.02d
  1181. // CHECK:STDOUT: }
  1182. // CHECK:STDOUT:
  1183. // CHECK:STDOUT: specific @MakeFromClass(constants.%N.335) {
  1184. // CHECK:STDOUT: %N => constants.%N.335
  1185. // CHECK:STDOUT: %N.patt => constants.%N.335
  1186. // CHECK:STDOUT: %ToLiteral.bound => constants.%ToLiteral.bound.8e3
  1187. // CHECK:STDOUT: %int.convert_checked => constants.%int.convert_checked.b6b
  1188. // CHECK:STDOUT: %iN.builtin => constants.%iN.builtin.9ef
  1189. // CHECK:STDOUT:
  1190. // CHECK:STDOUT: !definition:
  1191. // CHECK:STDOUT: %require_complete => constants.%require_complete.c7d
  1192. // CHECK:STDOUT: %MakeFromClass.specific_fn => constants.%MakeFromClass.specific_fn.004
  1193. // CHECK:STDOUT: }
  1194. // CHECK:STDOUT:
  1195. // CHECK:STDOUT: specific @MakeFromClass(%N) {}
  1196. // CHECK:STDOUT:
  1197. // CHECK:STDOUT: specific @MakeFromClass(constants.%int_64.06b) {
  1198. // CHECK:STDOUT: %N => constants.%int_64.06b
  1199. // CHECK:STDOUT: %N.patt => constants.%int_64.06b
  1200. // CHECK:STDOUT: %ToLiteral.bound => constants.%ToLiteral.bound.735
  1201. // CHECK:STDOUT: %int.convert_checked => constants.%int_64.fab
  1202. // CHECK:STDOUT: %iN.builtin => constants.%i64.builtin
  1203. // CHECK:STDOUT:
  1204. // CHECK:STDOUT: !definition:
  1205. // CHECK:STDOUT: %require_complete => constants.%complete_type.4a1
  1206. // CHECK:STDOUT: %MakeFromClass.specific_fn => constants.%MakeFromClass.specific_fn.61b
  1207. // CHECK:STDOUT: }
  1208. // CHECK:STDOUT: