implicit_imports_prelude.carbon 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  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. // This is just checking an implicit import behavior with the prelude present.
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/implicit_imports_prelude.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/implicit_imports_prelude.carbon
  12. // --- lib.carbon
  13. library "[[@TEST_NAME]]";
  14. var a: i32 = 0;
  15. // --- lib.impl.carbon
  16. impl library "[[@TEST_NAME]]";
  17. var b: i32 = a;
  18. // CHECK:STDOUT: --- lib.carbon
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: constants {
  21. // CHECK:STDOUT: %.1: Core.IntLiteral = int_value 32 [template]
  22. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  23. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  24. // CHECK:STDOUT: %i32: type = int_type signed, %.1 [template]
  25. // CHECK:STDOUT: %.2: Core.IntLiteral = int_value 0 [template]
  26. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  27. // CHECK:STDOUT: %Convert.type.14: type = fn_type @Convert.2, @impl.1(%.1) [template]
  28. // CHECK:STDOUT: %Convert.14: %Convert.type.14 = struct_value () [template]
  29. // CHECK:STDOUT: %.22: <witness> = interface_witness (%Convert.14) [template]
  30. // CHECK:STDOUT: %.23: <bound method> = bound_method %.2, %Convert.14 [template]
  31. // CHECK:STDOUT: %.24: <specific function> = specific_function %.23, @Convert.2(%.1) [template]
  32. // CHECK:STDOUT: %.25: %i32 = int_value 0 [template]
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT:
  35. // CHECK:STDOUT: imports {
  36. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  37. // CHECK:STDOUT: .Int = %import_ref.1
  38. // CHECK:STDOUT: .ImplicitAs = %import_ref.2
  39. // CHECK:STDOUT: import Core//prelude
  40. // CHECK:STDOUT: import Core//prelude/...
  41. // CHECK:STDOUT: }
  42. // CHECK:STDOUT: }
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: file {
  45. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  46. // CHECK:STDOUT: .Core = imports.%Core
  47. // CHECK:STDOUT: .a = %a
  48. // CHECK:STDOUT: }
  49. // CHECK:STDOUT: %Core.import = import Core
  50. // CHECK:STDOUT: %.loc4_8.1: Core.IntLiteral = int_value 32 [template = constants.%.1]
  51. // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_8.1) [template = constants.%i32]
  52. // CHECK:STDOUT: %.loc4_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
  53. // CHECK:STDOUT: %.loc4_8.3: type = converted %int.make_type_signed, %.loc4_8.2 [template = constants.%i32]
  54. // CHECK:STDOUT: %a.var: ref %i32 = var a
  55. // CHECK:STDOUT: %a: ref %i32 = bind_name a, %a.var
  56. // CHECK:STDOUT: }
  57. // CHECK:STDOUT:
  58. // CHECK:STDOUT: fn @__global_init() {
  59. // CHECK:STDOUT: !entry:
  60. // CHECK:STDOUT: %.loc4_14: Core.IntLiteral = int_value 0 [template = constants.%.2]
  61. // CHECK:STDOUT: %.loc4_15.1: %Convert.type.2 = interface_witness_access constants.%.22, element0 [template = constants.%Convert.14]
  62. // CHECK:STDOUT: %.loc4_15.2: <bound method> = bound_method %.loc4_14, %.loc4_15.1 [template = constants.%.23]
  63. // CHECK:STDOUT: %.loc4_15.3: <specific function> = specific_function %.loc4_15.2, @Convert.2(constants.%.1) [template = constants.%.24]
  64. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %.loc4_15.3(%.loc4_14) [template = constants.%.25]
  65. // CHECK:STDOUT: %.loc4_15.4: init %i32 = converted %.loc4_14, %int.convert_checked [template = constants.%.25]
  66. // CHECK:STDOUT: assign file.%a.var, %.loc4_15.4
  67. // CHECK:STDOUT: return
  68. // CHECK:STDOUT: }
  69. // CHECK:STDOUT:
  70. // CHECK:STDOUT: --- lib.impl.carbon
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: constants {
  73. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic]
  74. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic]
  75. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
  76. // CHECK:STDOUT: %ImplicitAs.type.2: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
  77. // CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
  78. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
  79. // CHECK:STDOUT: %ImplicitAs.type.3: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic]
  80. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic]
  81. // CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
  82. // CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic]
  83. // CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
  84. // CHECK:STDOUT: %.1: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
  85. // CHECK:STDOUT: %.2: %.1 = assoc_entity element0, imports.%import_ref.8 [symbolic]
  86. // CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.2, @impl.1(%N) [symbolic]
  87. // CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [symbolic]
  88. // CHECK:STDOUT: %.3: <witness> = interface_witness (%Convert.2) [symbolic]
  89. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic]
  90. // CHECK:STDOUT: %ImplicitAs.type.4: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic]
  91. // CHECK:STDOUT: %Convert.type.3: type = fn_type @Convert.3, @impl.2(%N) [symbolic]
  92. // CHECK:STDOUT: %Convert.3: %Convert.type.3 = struct_value () [symbolic]
  93. // CHECK:STDOUT: %.4: <witness> = interface_witness (%Convert.3) [symbolic]
  94. // CHECK:STDOUT: %ImplicitAs.type.5: type = facet_type <@ImplicitAs, @ImplicitAs(Core.IntLiteral)> [template]
  95. // CHECK:STDOUT: %Convert.type.4: type = fn_type @Convert.4, @impl.3(%N) [symbolic]
  96. // CHECK:STDOUT: %Convert.4: %Convert.type.4 = struct_value () [symbolic]
  97. // CHECK:STDOUT: %.5: <witness> = interface_witness (%Convert.4) [symbolic]
  98. // CHECK:STDOUT: %Convert.type.5: type = fn_type @Convert.1, @ImplicitAs(Core.IntLiteral) [template]
  99. // CHECK:STDOUT: %Convert.5: %Convert.type.5 = struct_value () [template]
  100. // CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.5, %Convert.type.5 [template]
  101. // CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.15 [template]
  102. // CHECK:STDOUT: %Convert.type.6: type = fn_type @Convert.5, @impl.4(%N) [symbolic]
  103. // CHECK:STDOUT: %Convert.6: %Convert.type.6 = struct_value () [symbolic]
  104. // CHECK:STDOUT: %.8: <witness> = interface_witness (%Convert.6) [symbolic]
  105. // CHECK:STDOUT: %As.type.2: type = facet_type <@As, @As(%Dest)> [symbolic]
  106. // CHECK:STDOUT: %Self.3: @As.%As.type (%As.type.2) = bind_symbolic_name Self, 1 [symbolic]
  107. // CHECK:STDOUT: %As.type.3: type = facet_type <@As, @As(%iN)> [symbolic]
  108. // CHECK:STDOUT: %Self.4: %As.type.2 = bind_symbolic_name Self, 1 [symbolic]
  109. // CHECK:STDOUT: %Convert.type.7: type = fn_type @Convert.6, @As(%Dest) [symbolic]
  110. // CHECK:STDOUT: %Convert.7: %Convert.type.7 = struct_value () [symbolic]
  111. // CHECK:STDOUT: %.9: type = assoc_entity_type %As.type.2, %Convert.type.7 [symbolic]
  112. // CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.25 [symbolic]
  113. // CHECK:STDOUT: %Convert.type.8: type = fn_type @Convert.7, @impl.5(%N) [symbolic]
  114. // CHECK:STDOUT: %Convert.8: %Convert.type.8 = struct_value () [symbolic]
  115. // CHECK:STDOUT: %.11: <witness> = interface_witness (%Convert.8) [symbolic]
  116. // CHECK:STDOUT: %As.type.4: type = facet_type <@As, @As(%uN)> [symbolic]
  117. // CHECK:STDOUT: %Convert.type.9: type = fn_type @Convert.8, @impl.6(%N) [symbolic]
  118. // CHECK:STDOUT: %Convert.9: %Convert.type.9 = struct_value () [symbolic]
  119. // CHECK:STDOUT: %.12: <witness> = interface_witness (%Convert.9) [symbolic]
  120. // CHECK:STDOUT: %As.type.5: type = facet_type <@As, @As(Core.IntLiteral)> [template]
  121. // CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.9, @impl.7(%N) [symbolic]
  122. // CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [symbolic]
  123. // CHECK:STDOUT: %.13: <witness> = interface_witness (%Convert.10) [symbolic]
  124. // CHECK:STDOUT: %Convert.type.11: type = fn_type @Convert.6, @As(Core.IntLiteral) [template]
  125. // CHECK:STDOUT: %Convert.11: %Convert.type.11 = struct_value () [template]
  126. // CHECK:STDOUT: %.14: type = assoc_entity_type %As.type.5, %Convert.type.11 [template]
  127. // CHECK:STDOUT: %.15: %.14 = assoc_entity element0, imports.%import_ref.32 [template]
  128. // CHECK:STDOUT: %Convert.type.12: type = fn_type @Convert.10, @impl.8(%N) [symbolic]
  129. // CHECK:STDOUT: %Convert.12: %Convert.type.12 = struct_value () [symbolic]
  130. // CHECK:STDOUT: %.16: <witness> = interface_witness (%Convert.12) [symbolic]
  131. // CHECK:STDOUT: %.17: Core.IntLiteral = int_value 32 [template]
  132. // CHECK:STDOUT: %Int.type: type = fn_type @Int [template]
  133. // CHECK:STDOUT: %Int: %Int.type = struct_value () [template]
  134. // CHECK:STDOUT: %i32: type = int_type signed, %.17 [template]
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: imports {
  138. // CHECK:STDOUT: %import_ref.1: ref %i32 = import_ref Main//lib, inst+22, loaded
  139. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  140. // CHECK:STDOUT: .Int = %import_ref.36
  141. // CHECK:STDOUT: import Core//prelude
  142. // CHECK:STDOUT: import Core//prelude/...
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT: %import_ref.2 = import_ref Main//lib, inst+37, unloaded
  145. // CHECK:STDOUT: %import_ref.3 = import_ref Main//lib, inst+38, unloaded
  146. // CHECK:STDOUT: %import_ref.4 = import_ref Main//lib, inst+39, unloaded
  147. // CHECK:STDOUT: %import_ref.5: type = import_ref Main//lib, inst+81, loaded [template = Core.IntLiteral]
  148. // CHECK:STDOUT: %import_ref.6: type = import_ref Main//lib, inst+82, loaded [symbolic = @impl.1.%ImplicitAs.type (constants.%ImplicitAs.type.3)]
  149. // CHECK:STDOUT: %import_ref.7 = import_ref Main//lib, inst+83, unloaded
  150. // CHECK:STDOUT: %import_ref.8 = import_ref Main//lib, inst+54, unloaded
  151. // CHECK:STDOUT: %import_ref.9: type = import_ref Main//lib, inst+111, loaded [template = Core.IntLiteral]
  152. // CHECK:STDOUT: %import_ref.10: type = import_ref Main//lib, inst+112, loaded [symbolic = @impl.2.%ImplicitAs.type (constants.%ImplicitAs.type.4)]
  153. // CHECK:STDOUT: %import_ref.11 = import_ref Main//lib, inst+113, unloaded
  154. // CHECK:STDOUT: %import_ref.12: type = import_ref Main//lib, inst+140, loaded [symbolic = @impl.3.%iN (constants.%iN)]
  155. // CHECK:STDOUT: %import_ref.13: type = import_ref Main//lib, inst+141, loaded [template = constants.%ImplicitAs.type.5]
  156. // CHECK:STDOUT: %import_ref.14 = import_ref Main//lib, inst+142, unloaded
  157. // CHECK:STDOUT: %import_ref.16: type = import_ref Main//lib, inst+172, loaded [symbolic = @impl.4.%uN (constants.%uN)]
  158. // CHECK:STDOUT: %import_ref.17: type = import_ref Main//lib, inst+173, loaded [template = constants.%ImplicitAs.type.5]
  159. // CHECK:STDOUT: %import_ref.18 = import_ref Main//lib, inst+174, unloaded
  160. // CHECK:STDOUT: %import_ref.19 = import_ref Main//lib, inst+204, unloaded
  161. // CHECK:STDOUT: %import_ref.20 = import_ref Main//lib, inst+205, unloaded
  162. // CHECK:STDOUT: %import_ref.21 = import_ref Main//lib, inst+206, unloaded
  163. // CHECK:STDOUT: %import_ref.22: type = import_ref Main//lib, inst+212, loaded [template = Core.IntLiteral]
  164. // CHECK:STDOUT: %import_ref.23: type = import_ref Main//lib, inst+213, loaded [symbolic = @impl.5.%As.type (constants.%As.type.3)]
  165. // CHECK:STDOUT: %import_ref.24 = import_ref Main//lib, inst+214, unloaded
  166. // CHECK:STDOUT: %import_ref.25 = import_ref Main//lib, inst+229, unloaded
  167. // CHECK:STDOUT: %import_ref.26: type = import_ref Main//lib, inst+266, loaded [template = Core.IntLiteral]
  168. // CHECK:STDOUT: %import_ref.27: type = import_ref Main//lib, inst+267, loaded [symbolic = @impl.6.%As.type (constants.%As.type.4)]
  169. // CHECK:STDOUT: %import_ref.28 = import_ref Main//lib, inst+268, unloaded
  170. // CHECK:STDOUT: %import_ref.29: type = import_ref Main//lib, inst+295, loaded [symbolic = @impl.7.%iN (constants.%iN)]
  171. // CHECK:STDOUT: %import_ref.30: type = import_ref Main//lib, inst+296, loaded [template = constants.%As.type.5]
  172. // CHECK:STDOUT: %import_ref.31 = import_ref Main//lib, inst+297, unloaded
  173. // CHECK:STDOUT: %import_ref.33: type = import_ref Main//lib, inst+327, loaded [symbolic = @impl.8.%uN (constants.%uN)]
  174. // CHECK:STDOUT: %import_ref.34: type = import_ref Main//lib, inst+328, loaded [template = constants.%As.type.5]
  175. // CHECK:STDOUT: %import_ref.35 = import_ref Main//lib, inst+329, unloaded
  176. // CHECK:STDOUT: }
  177. // CHECK:STDOUT:
  178. // CHECK:STDOUT: file {
  179. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  180. // CHECK:STDOUT: .a = imports.%import_ref.1
  181. // CHECK:STDOUT: .Core = imports.%Core
  182. // CHECK:STDOUT: .b = %b
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT: %default.import.loc2_6.1 = import <invalid>
  185. // CHECK:STDOUT: %default.import.loc2_6.2 = import <invalid>
  186. // CHECK:STDOUT: %Core.import = import Core
  187. // CHECK:STDOUT: %.loc4_8.1: Core.IntLiteral = int_value 32 [template = constants.%.17]
  188. // CHECK:STDOUT: %int.make_type_signed: init type = call constants.%Int(%.loc4_8.1) [template = constants.%i32]
  189. // CHECK:STDOUT: %.loc4_8.2: type = value_of_initializer %int.make_type_signed [template = constants.%i32]
  190. // CHECK:STDOUT: %.loc4_8.3: type = converted %int.make_type_signed, %.loc4_8.2 [template = constants.%i32]
  191. // CHECK:STDOUT: %b.var: ref %i32 = var b
  192. // CHECK:STDOUT: %b: ref %i32 = bind_name b, %b.var
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT:
  195. // CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
  196. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  197. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  198. // CHECK:STDOUT:
  199. // CHECK:STDOUT: !definition:
  200. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  201. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  202. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.1, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
  203. // CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
  204. // CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.1)]
  205. // CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.1) = assoc_entity element0, imports.%import_ref.8 [symbolic = %.2 (constants.%.2)]
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: interface {
  208. // CHECK:STDOUT: !members:
  209. // CHECK:STDOUT: .Self = imports.%import_ref.2
  210. // CHECK:STDOUT: .Convert = imports.%import_ref.3
  211. // CHECK:STDOUT: witness = (imports.%import_ref.4)
  212. // CHECK:STDOUT: }
  213. // CHECK:STDOUT: }
  214. // CHECK:STDOUT:
  215. // CHECK:STDOUT: generic interface @As(constants.%Dest: type) {
  216. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  217. // CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
  218. // CHECK:STDOUT:
  219. // CHECK:STDOUT: !definition:
  220. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)]
  221. // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)]
  222. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.6, @As(%Dest) [symbolic = %Convert.type (constants.%Convert.type.7)]
  223. // CHECK:STDOUT: %Convert: @As.%Convert.type (%Convert.type.7) = struct_value () [symbolic = %Convert (constants.%Convert.7)]
  224. // CHECK:STDOUT: %.1: type = assoc_entity_type @As.%As.type (%As.type.2), @As.%Convert.type (%Convert.type.7) [symbolic = %.1 (constants.%.9)]
  225. // CHECK:STDOUT: %.2: @As.%.1 (%.9) = assoc_entity element0, imports.%import_ref.25 [symbolic = %.2 (constants.%.10)]
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: interface {
  228. // CHECK:STDOUT: !members:
  229. // CHECK:STDOUT: .Self = imports.%import_ref.19
  230. // CHECK:STDOUT: .Convert = imports.%import_ref.20
  231. // CHECK:STDOUT: witness = (imports.%import_ref.21)
  232. // CHECK:STDOUT: }
  233. // CHECK:STDOUT: }
  234. // CHECK:STDOUT:
  235. // CHECK:STDOUT: generic impl @impl.1(constants.%N: Core.IntLiteral) {
  236. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  237. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  238. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  239. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%iN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.3)]
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: !definition:
  242. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.2, @impl.1(%N) [symbolic = %Convert.type (constants.%Convert.type.2)]
  243. // CHECK:STDOUT: %Convert: @impl.1.%Convert.type (%Convert.type.2) = struct_value () [symbolic = %Convert (constants.%Convert.2)]
  244. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.3)]
  245. // CHECK:STDOUT:
  246. // CHECK:STDOUT: impl: imports.%import_ref.5 as imports.%import_ref.6 {
  247. // CHECK:STDOUT: !members:
  248. // CHECK:STDOUT: witness = imports.%import_ref.7
  249. // CHECK:STDOUT: }
  250. // CHECK:STDOUT: }
  251. // CHECK:STDOUT:
  252. // CHECK:STDOUT: generic impl @impl.2(constants.%N: Core.IntLiteral) {
  253. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  254. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  255. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  256. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%uN)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.4)]
  257. // CHECK:STDOUT:
  258. // CHECK:STDOUT: !definition:
  259. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.3, @impl.2(%N) [symbolic = %Convert.type (constants.%Convert.type.3)]
  260. // CHECK:STDOUT: %Convert: @impl.2.%Convert.type (%Convert.type.3) = struct_value () [symbolic = %Convert (constants.%Convert.3)]
  261. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.4)]
  262. // CHECK:STDOUT:
  263. // CHECK:STDOUT: impl: imports.%import_ref.9 as imports.%import_ref.10 {
  264. // CHECK:STDOUT: !members:
  265. // CHECK:STDOUT: witness = imports.%import_ref.11
  266. // CHECK:STDOUT: }
  267. // CHECK:STDOUT: }
  268. // CHECK:STDOUT:
  269. // CHECK:STDOUT: generic impl @impl.3(constants.%N: Core.IntLiteral) {
  270. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  271. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  272. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  273. // CHECK:STDOUT:
  274. // CHECK:STDOUT: !definition:
  275. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.4, @impl.3(%N) [symbolic = %Convert.type (constants.%Convert.type.4)]
  276. // CHECK:STDOUT: %Convert: @impl.3.%Convert.type (%Convert.type.4) = struct_value () [symbolic = %Convert (constants.%Convert.4)]
  277. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.5)]
  278. // CHECK:STDOUT:
  279. // CHECK:STDOUT: impl: imports.%import_ref.12 as imports.%import_ref.13 {
  280. // CHECK:STDOUT: !members:
  281. // CHECK:STDOUT: witness = imports.%import_ref.14
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT: }
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: generic impl @impl.4(constants.%N: Core.IntLiteral) {
  286. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  287. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  288. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: !definition:
  291. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.5, @impl.4(%N) [symbolic = %Convert.type (constants.%Convert.type.6)]
  292. // CHECK:STDOUT: %Convert: @impl.4.%Convert.type (%Convert.type.6) = struct_value () [symbolic = %Convert (constants.%Convert.6)]
  293. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.8)]
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: impl: imports.%import_ref.16 as imports.%import_ref.17 {
  296. // CHECK:STDOUT: !members:
  297. // CHECK:STDOUT: witness = imports.%import_ref.18
  298. // CHECK:STDOUT: }
  299. // CHECK:STDOUT: }
  300. // CHECK:STDOUT:
  301. // CHECK:STDOUT: generic impl @impl.5(constants.%N: Core.IntLiteral) {
  302. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  303. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  304. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  305. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%iN)> [symbolic = %As.type (constants.%As.type.3)]
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: !definition:
  308. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.7, @impl.5(%N) [symbolic = %Convert.type (constants.%Convert.type.8)]
  309. // CHECK:STDOUT: %Convert: @impl.5.%Convert.type (%Convert.type.8) = struct_value () [symbolic = %Convert (constants.%Convert.8)]
  310. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.11)]
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: impl: imports.%import_ref.22 as imports.%import_ref.23 {
  313. // CHECK:STDOUT: !members:
  314. // CHECK:STDOUT: witness = imports.%import_ref.24
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT: }
  317. // CHECK:STDOUT:
  318. // CHECK:STDOUT: generic impl @impl.6(constants.%N: Core.IntLiteral) {
  319. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  320. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  321. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  322. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%uN)> [symbolic = %As.type (constants.%As.type.4)]
  323. // CHECK:STDOUT:
  324. // CHECK:STDOUT: !definition:
  325. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.8, @impl.6(%N) [symbolic = %Convert.type (constants.%Convert.type.9)]
  326. // CHECK:STDOUT: %Convert: @impl.6.%Convert.type (%Convert.type.9) = struct_value () [symbolic = %Convert (constants.%Convert.9)]
  327. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.12)]
  328. // CHECK:STDOUT:
  329. // CHECK:STDOUT: impl: imports.%import_ref.26 as imports.%import_ref.27 {
  330. // CHECK:STDOUT: !members:
  331. // CHECK:STDOUT: witness = imports.%import_ref.28
  332. // CHECK:STDOUT: }
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: generic impl @impl.7(constants.%N: Core.IntLiteral) {
  336. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  337. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  338. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  339. // CHECK:STDOUT:
  340. // CHECK:STDOUT: !definition:
  341. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.9, @impl.7(%N) [symbolic = %Convert.type (constants.%Convert.type.10)]
  342. // CHECK:STDOUT: %Convert: @impl.7.%Convert.type (%Convert.type.10) = struct_value () [symbolic = %Convert (constants.%Convert.10)]
  343. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.13)]
  344. // CHECK:STDOUT:
  345. // CHECK:STDOUT: impl: imports.%import_ref.29 as imports.%import_ref.30 {
  346. // CHECK:STDOUT: !members:
  347. // CHECK:STDOUT: witness = imports.%import_ref.31
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT: }
  350. // CHECK:STDOUT:
  351. // CHECK:STDOUT: generic impl @impl.8(constants.%N: Core.IntLiteral) {
  352. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  353. // CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)]
  354. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  355. // CHECK:STDOUT:
  356. // CHECK:STDOUT: !definition:
  357. // CHECK:STDOUT: %Convert.type: type = fn_type @Convert.10, @impl.8(%N) [symbolic = %Convert.type (constants.%Convert.type.12)]
  358. // CHECK:STDOUT: %Convert: @impl.8.%Convert.type (%Convert.type.12) = struct_value () [symbolic = %Convert (constants.%Convert.12)]
  359. // CHECK:STDOUT: %.1: <witness> = interface_witness (%Convert) [symbolic = %.1 (constants.%.16)]
  360. // CHECK:STDOUT:
  361. // CHECK:STDOUT: impl: imports.%import_ref.33 as imports.%import_ref.34 {
  362. // CHECK:STDOUT: !members:
  363. // CHECK:STDOUT: witness = imports.%import_ref.35
  364. // CHECK:STDOUT: }
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: generic fn @Convert.1(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
  368. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  369. // CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
  370. // CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
  371. // CHECK:STDOUT:
  372. // CHECK:STDOUT: fn[%self.param_patt: @Convert.1.%Self (%Self.2)]() -> @Convert.1.%Dest (%Dest);
  373. // CHECK:STDOUT: }
  374. // CHECK:STDOUT:
  375. // CHECK:STDOUT: generic fn @Convert.2(constants.%N: Core.IntLiteral) {
  376. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  377. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  378. // CHECK:STDOUT:
  379. // CHECK:STDOUT: !definition:
  380. // CHECK:STDOUT:
  381. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.2.%iN (%iN) = "int.convert_checked";
  382. // CHECK:STDOUT: }
  383. // CHECK:STDOUT:
  384. // CHECK:STDOUT: generic fn @Convert.3(constants.%N: Core.IntLiteral) {
  385. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  386. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: !definition:
  389. // CHECK:STDOUT:
  390. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.3.%uN (%uN) = "int.convert_checked";
  391. // CHECK:STDOUT: }
  392. // CHECK:STDOUT:
  393. // CHECK:STDOUT: generic fn @Convert.4(constants.%N: Core.IntLiteral) {
  394. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  395. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  396. // CHECK:STDOUT:
  397. // CHECK:STDOUT: !definition:
  398. // CHECK:STDOUT:
  399. // CHECK:STDOUT: fn[%self.param_patt: @Convert.4.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked";
  400. // CHECK:STDOUT: }
  401. // CHECK:STDOUT:
  402. // CHECK:STDOUT: generic fn @Convert.5(constants.%N: Core.IntLiteral) {
  403. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  404. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  405. // CHECK:STDOUT:
  406. // CHECK:STDOUT: !definition:
  407. // CHECK:STDOUT:
  408. // CHECK:STDOUT: fn[%self.param_patt: @Convert.5.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked";
  409. // CHECK:STDOUT: }
  410. // CHECK:STDOUT:
  411. // CHECK:STDOUT: generic fn @Convert.6(constants.%Dest: type, constants.%Self.3: @As.%As.type (%As.type.2)) {
  412. // CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
  413. // CHECK:STDOUT: %As.type: type = facet_type <@As, @As(%Dest)> [symbolic = %As.type (constants.%As.type.2)]
  414. // CHECK:STDOUT: %Self: %As.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.4)]
  415. // CHECK:STDOUT:
  416. // CHECK:STDOUT: fn[%self.param_patt: @Convert.6.%Self (%Self.4)]() -> @Convert.6.%Dest (%Dest);
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT:
  419. // CHECK:STDOUT: generic fn @Convert.7(constants.%N: Core.IntLiteral) {
  420. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  421. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  422. // CHECK:STDOUT:
  423. // CHECK:STDOUT: !definition:
  424. // CHECK:STDOUT:
  425. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.7.%iN (%iN) = "int.convert_checked";
  426. // CHECK:STDOUT: }
  427. // CHECK:STDOUT:
  428. // CHECK:STDOUT: generic fn @Convert.8(constants.%N: Core.IntLiteral) {
  429. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  430. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  431. // CHECK:STDOUT:
  432. // CHECK:STDOUT: !definition:
  433. // CHECK:STDOUT:
  434. // CHECK:STDOUT: fn[%self.param_patt: Core.IntLiteral]() -> @Convert.8.%uN (%uN) = "int.convert_checked";
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: generic fn @Convert.9(constants.%N: Core.IntLiteral) {
  438. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  439. // CHECK:STDOUT: %iN: type = int_type signed, %N [symbolic = %iN (constants.%iN)]
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: !definition:
  442. // CHECK:STDOUT:
  443. // CHECK:STDOUT: fn[%self.param_patt: @Convert.9.%iN (%iN)]() -> Core.IntLiteral = "int.convert_checked";
  444. // CHECK:STDOUT: }
  445. // CHECK:STDOUT:
  446. // CHECK:STDOUT: generic fn @Convert.10(constants.%N: Core.IntLiteral) {
  447. // CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)]
  448. // CHECK:STDOUT: %uN: type = int_type unsigned, %N [symbolic = %uN (constants.%uN)]
  449. // CHECK:STDOUT:
  450. // CHECK:STDOUT: !definition:
  451. // CHECK:STDOUT:
  452. // CHECK:STDOUT: fn[%self.param_patt: @Convert.10.%uN (%uN)]() -> Core.IntLiteral = "int.convert_checked";
  453. // CHECK:STDOUT: }
  454. // CHECK:STDOUT:
  455. // CHECK:STDOUT: fn @__global_init() {
  456. // CHECK:STDOUT: !entry:
  457. // CHECK:STDOUT: %a.ref: ref %i32 = name_ref a, imports.%import_ref.1
  458. // CHECK:STDOUT: %.loc4: %i32 = bind_value %a.ref
  459. // CHECK:STDOUT: assign file.%b.var, %.loc4
  460. // CHECK:STDOUT: return
  461. // CHECK:STDOUT: }
  462. // CHECK:STDOUT:
  463. // CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
  464. // CHECK:STDOUT: %Dest => constants.%Dest
  465. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  466. // CHECK:STDOUT: }
  467. // CHECK:STDOUT:
  468. // CHECK:STDOUT: specific @ImplicitAs(constants.%iN) {
  469. // CHECK:STDOUT: %Dest => constants.%iN
  470. // CHECK:STDOUT: %Dest.patt => constants.%iN
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT:
  473. // CHECK:STDOUT: specific @ImplicitAs(%Dest) {
  474. // CHECK:STDOUT: %Dest => constants.%Dest
  475. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  476. // CHECK:STDOUT: }
  477. // CHECK:STDOUT:
  478. // CHECK:STDOUT: specific @ImplicitAs(@impl.1.%iN) {
  479. // CHECK:STDOUT: %Dest => constants.%iN
  480. // CHECK:STDOUT: %Dest.patt => constants.%iN
  481. // CHECK:STDOUT: }
  482. // CHECK:STDOUT:
  483. // CHECK:STDOUT: specific @impl.1(constants.%N) {
  484. // CHECK:STDOUT: %N => constants.%N
  485. // CHECK:STDOUT: %N.patt => constants.%N
  486. // CHECK:STDOUT: %iN => constants.%iN
  487. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  488. // CHECK:STDOUT: }
  489. // CHECK:STDOUT:
  490. // CHECK:STDOUT: specific @impl.1(%N) {
  491. // CHECK:STDOUT: %N => constants.%N
  492. // CHECK:STDOUT: %N.patt => constants.%N
  493. // CHECK:STDOUT: %iN => constants.%iN
  494. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
  495. // CHECK:STDOUT: }
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: specific @ImplicitAs(@Convert.1.%Dest) {
  498. // CHECK:STDOUT: %Dest => constants.%Dest
  499. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  500. // CHECK:STDOUT: }
  501. // CHECK:STDOUT:
  502. // CHECK:STDOUT: specific @Convert.1(constants.%Dest, constants.%Self.1) {
  503. // CHECK:STDOUT: %Dest => constants.%Dest
  504. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
  505. // CHECK:STDOUT: %Self => constants.%Self.1
  506. // CHECK:STDOUT: }
  507. // CHECK:STDOUT:
  508. // CHECK:STDOUT: specific @Convert.2(constants.%N) {
  509. // CHECK:STDOUT: %N => constants.%N
  510. // CHECK:STDOUT: %iN => constants.%iN
  511. // CHECK:STDOUT: }
  512. // CHECK:STDOUT:
  513. // CHECK:STDOUT: specific @ImplicitAs(constants.%uN) {
  514. // CHECK:STDOUT: %Dest => constants.%uN
  515. // CHECK:STDOUT: %Dest.patt => constants.%uN
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT:
  518. // CHECK:STDOUT: specific @ImplicitAs(@impl.2.%uN) {
  519. // CHECK:STDOUT: %Dest => constants.%uN
  520. // CHECK:STDOUT: %Dest.patt => constants.%uN
  521. // CHECK:STDOUT: }
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: specific @impl.2(constants.%N) {
  524. // CHECK:STDOUT: %N => constants.%N
  525. // CHECK:STDOUT: %N.patt => constants.%N
  526. // CHECK:STDOUT: %uN => constants.%uN
  527. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  528. // CHECK:STDOUT: }
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: specific @impl.2(%N) {
  531. // CHECK:STDOUT: %N => constants.%N
  532. // CHECK:STDOUT: %N.patt => constants.%N
  533. // CHECK:STDOUT: %uN => constants.%uN
  534. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.4
  535. // CHECK:STDOUT: }
  536. // CHECK:STDOUT:
  537. // CHECK:STDOUT: specific @Convert.3(constants.%N) {
  538. // CHECK:STDOUT: %N => constants.%N
  539. // CHECK:STDOUT: %uN => constants.%uN
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT:
  542. // CHECK:STDOUT: specific @ImplicitAs(Core.IntLiteral) {
  543. // CHECK:STDOUT: %Dest => Core.IntLiteral
  544. // CHECK:STDOUT: %Dest.patt => Core.IntLiteral
  545. // CHECK:STDOUT:
  546. // CHECK:STDOUT: !definition:
  547. // CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.5
  548. // CHECK:STDOUT: %Self => constants.%Self.2
  549. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.5
  550. // CHECK:STDOUT: %Convert => constants.%Convert.5
  551. // CHECK:STDOUT: %.1 => constants.%.6
  552. // CHECK:STDOUT: %.2 => constants.%.7
  553. // CHECK:STDOUT: }
  554. // CHECK:STDOUT:
  555. // CHECK:STDOUT: specific @impl.3(constants.%N) {
  556. // CHECK:STDOUT: %N => constants.%N
  557. // CHECK:STDOUT: %N.patt => constants.%N
  558. // CHECK:STDOUT: %iN => constants.%iN
  559. // CHECK:STDOUT: }
  560. // CHECK:STDOUT:
  561. // CHECK:STDOUT: specific @impl.3(%N) {
  562. // CHECK:STDOUT: %N => constants.%N
  563. // CHECK:STDOUT: %N.patt => constants.%N
  564. // CHECK:STDOUT: %iN => constants.%iN
  565. // CHECK:STDOUT: }
  566. // CHECK:STDOUT:
  567. // CHECK:STDOUT: specific @Convert.4(constants.%N) {
  568. // CHECK:STDOUT: %N => constants.%N
  569. // CHECK:STDOUT: %iN => constants.%iN
  570. // CHECK:STDOUT: }
  571. // CHECK:STDOUT:
  572. // CHECK:STDOUT: specific @impl.4(constants.%N) {
  573. // CHECK:STDOUT: %N => constants.%N
  574. // CHECK:STDOUT: %N.patt => constants.%N
  575. // CHECK:STDOUT: %uN => constants.%uN
  576. // CHECK:STDOUT: }
  577. // CHECK:STDOUT:
  578. // CHECK:STDOUT: specific @impl.4(%N) {
  579. // CHECK:STDOUT: %N => constants.%N
  580. // CHECK:STDOUT: %N.patt => constants.%N
  581. // CHECK:STDOUT: %uN => constants.%uN
  582. // CHECK:STDOUT: }
  583. // CHECK:STDOUT:
  584. // CHECK:STDOUT: specific @Convert.5(constants.%N) {
  585. // CHECK:STDOUT: %N => constants.%N
  586. // CHECK:STDOUT: %uN => constants.%uN
  587. // CHECK:STDOUT: }
  588. // CHECK:STDOUT:
  589. // CHECK:STDOUT: specific @As(constants.%Dest) {
  590. // CHECK:STDOUT: %Dest => constants.%Dest
  591. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  592. // CHECK:STDOUT: }
  593. // CHECK:STDOUT:
  594. // CHECK:STDOUT: specific @As(constants.%iN) {
  595. // CHECK:STDOUT: %Dest => constants.%iN
  596. // CHECK:STDOUT: %Dest.patt => constants.%iN
  597. // CHECK:STDOUT: }
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: specific @As(%Dest) {
  600. // CHECK:STDOUT: %Dest => constants.%Dest
  601. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  602. // CHECK:STDOUT: }
  603. // CHECK:STDOUT:
  604. // CHECK:STDOUT: specific @As(@impl.5.%iN) {
  605. // CHECK:STDOUT: %Dest => constants.%iN
  606. // CHECK:STDOUT: %Dest.patt => constants.%iN
  607. // CHECK:STDOUT: }
  608. // CHECK:STDOUT:
  609. // CHECK:STDOUT: specific @impl.5(constants.%N) {
  610. // CHECK:STDOUT: %N => constants.%N
  611. // CHECK:STDOUT: %N.patt => constants.%N
  612. // CHECK:STDOUT: %iN => constants.%iN
  613. // CHECK:STDOUT: %As.type => constants.%As.type.3
  614. // CHECK:STDOUT: }
  615. // CHECK:STDOUT:
  616. // CHECK:STDOUT: specific @impl.5(%N) {
  617. // CHECK:STDOUT: %N => constants.%N
  618. // CHECK:STDOUT: %N.patt => constants.%N
  619. // CHECK:STDOUT: %iN => constants.%iN
  620. // CHECK:STDOUT: %As.type => constants.%As.type.3
  621. // CHECK:STDOUT: }
  622. // CHECK:STDOUT:
  623. // CHECK:STDOUT: specific @As(@Convert.6.%Dest) {
  624. // CHECK:STDOUT: %Dest => constants.%Dest
  625. // CHECK:STDOUT: %Dest.patt => constants.%Dest
  626. // CHECK:STDOUT: }
  627. // CHECK:STDOUT:
  628. // CHECK:STDOUT: specific @Convert.6(constants.%Dest, constants.%Self.3) {
  629. // CHECK:STDOUT: %Dest => constants.%Dest
  630. // CHECK:STDOUT: %As.type => constants.%As.type.2
  631. // CHECK:STDOUT: %Self => constants.%Self.3
  632. // CHECK:STDOUT: }
  633. // CHECK:STDOUT:
  634. // CHECK:STDOUT: specific @Convert.7(constants.%N) {
  635. // CHECK:STDOUT: %N => constants.%N
  636. // CHECK:STDOUT: %iN => constants.%iN
  637. // CHECK:STDOUT: }
  638. // CHECK:STDOUT:
  639. // CHECK:STDOUT: specific @As(constants.%uN) {
  640. // CHECK:STDOUT: %Dest => constants.%uN
  641. // CHECK:STDOUT: %Dest.patt => constants.%uN
  642. // CHECK:STDOUT: }
  643. // CHECK:STDOUT:
  644. // CHECK:STDOUT: specific @As(@impl.6.%uN) {
  645. // CHECK:STDOUT: %Dest => constants.%uN
  646. // CHECK:STDOUT: %Dest.patt => constants.%uN
  647. // CHECK:STDOUT: }
  648. // CHECK:STDOUT:
  649. // CHECK:STDOUT: specific @impl.6(constants.%N) {
  650. // CHECK:STDOUT: %N => constants.%N
  651. // CHECK:STDOUT: %N.patt => constants.%N
  652. // CHECK:STDOUT: %uN => constants.%uN
  653. // CHECK:STDOUT: %As.type => constants.%As.type.4
  654. // CHECK:STDOUT: }
  655. // CHECK:STDOUT:
  656. // CHECK:STDOUT: specific @impl.6(%N) {
  657. // CHECK:STDOUT: %N => constants.%N
  658. // CHECK:STDOUT: %N.patt => constants.%N
  659. // CHECK:STDOUT: %uN => constants.%uN
  660. // CHECK:STDOUT: %As.type => constants.%As.type.4
  661. // CHECK:STDOUT: }
  662. // CHECK:STDOUT:
  663. // CHECK:STDOUT: specific @Convert.8(constants.%N) {
  664. // CHECK:STDOUT: %N => constants.%N
  665. // CHECK:STDOUT: %uN => constants.%uN
  666. // CHECK:STDOUT: }
  667. // CHECK:STDOUT:
  668. // CHECK:STDOUT: specific @As(Core.IntLiteral) {
  669. // CHECK:STDOUT: %Dest => Core.IntLiteral
  670. // CHECK:STDOUT: %Dest.patt => Core.IntLiteral
  671. // CHECK:STDOUT:
  672. // CHECK:STDOUT: !definition:
  673. // CHECK:STDOUT: %As.type => constants.%As.type.5
  674. // CHECK:STDOUT: %Self => constants.%Self.4
  675. // CHECK:STDOUT: %Convert.type => constants.%Convert.type.11
  676. // CHECK:STDOUT: %Convert => constants.%Convert.11
  677. // CHECK:STDOUT: %.1 => constants.%.14
  678. // CHECK:STDOUT: %.2 => constants.%.15
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT:
  681. // CHECK:STDOUT: specific @impl.7(constants.%N) {
  682. // CHECK:STDOUT: %N => constants.%N
  683. // CHECK:STDOUT: %N.patt => constants.%N
  684. // CHECK:STDOUT: %iN => constants.%iN
  685. // CHECK:STDOUT: }
  686. // CHECK:STDOUT:
  687. // CHECK:STDOUT: specific @impl.7(%N) {
  688. // CHECK:STDOUT: %N => constants.%N
  689. // CHECK:STDOUT: %N.patt => constants.%N
  690. // CHECK:STDOUT: %iN => constants.%iN
  691. // CHECK:STDOUT: }
  692. // CHECK:STDOUT:
  693. // CHECK:STDOUT: specific @Convert.9(constants.%N) {
  694. // CHECK:STDOUT: %N => constants.%N
  695. // CHECK:STDOUT: %iN => constants.%iN
  696. // CHECK:STDOUT: }
  697. // CHECK:STDOUT:
  698. // CHECK:STDOUT: specific @impl.8(constants.%N) {
  699. // CHECK:STDOUT: %N => constants.%N
  700. // CHECK:STDOUT: %N.patt => constants.%N
  701. // CHECK:STDOUT: %uN => constants.%uN
  702. // CHECK:STDOUT: }
  703. // CHECK:STDOUT:
  704. // CHECK:STDOUT: specific @impl.8(%N) {
  705. // CHECK:STDOUT: %N => constants.%N
  706. // CHECK:STDOUT: %N.patt => constants.%N
  707. // CHECK:STDOUT: %uN => constants.%uN
  708. // CHECK:STDOUT: }
  709. // CHECK:STDOUT:
  710. // CHECK:STDOUT: specific @Convert.10(constants.%N) {
  711. // CHECK:STDOUT: %N => constants.%N
  712. // CHECK:STDOUT: %uN => constants.%uN
  713. // CHECK:STDOUT: }
  714. // CHECK:STDOUT: