import_builtin_call.carbon 88 KB

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