import.carbon 40 KB

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