raw_core.carbon 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/raw_core.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/raw_core.carbon
  14. // --- package_raw_core.carbon
  15. package r#Core;
  16. fn F();
  17. // --- import_raw_core.carbon
  18. library "[[@TEST_NAME]]";
  19. import r#Core;
  20. fn G() { r#Core.F(); }
  21. fn H() { Core.Int(32); }
  22. // --- fail_raw_core_not_core.carbon
  23. library "[[@TEST_NAME]]";
  24. import r#Core;
  25. // CHECK:STDERR: fail_raw_core_not_core.carbon:[[@LINE+4]]:10: error: member name `F` not found in `Core` [MemberNameNotFoundInInstScope]
  26. // CHECK:STDERR: fn G() { Core.F(); }
  27. // CHECK:STDERR: ^~~~~~
  28. // CHECK:STDERR:
  29. fn G() { Core.F(); }
  30. // CHECK:STDERR: fail_raw_core_not_core.carbon:[[@LINE+4]]:10: error: member name `Int` not found in `r#Core` [MemberNameNotFoundInInstScope]
  31. // CHECK:STDERR: fn H() { r#Core.Int(32); }
  32. // CHECK:STDERR: ^~~~~~~~~~
  33. // CHECK:STDERR:
  34. fn H() { r#Core.Int(32); }
  35. // --- class_raw_core.carbon
  36. class r#Core {
  37. var n: Core.Int(32);
  38. }
  39. var c: r#Core = {.n = 0 as Core.Int(32)};
  40. // CHECK:STDOUT: --- package_raw_core.carbon
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: constants {
  43. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  44. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  45. // CHECK:STDOUT: }
  46. // CHECK:STDOUT:
  47. // CHECK:STDOUT: imports {
  48. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  49. // CHECK:STDOUT: import Core//prelude
  50. // CHECK:STDOUT: import Core//prelude/...
  51. // CHECK:STDOUT: }
  52. // CHECK:STDOUT: }
  53. // CHECK:STDOUT:
  54. // CHECK:STDOUT: file {
  55. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  56. // CHECK:STDOUT: .Core = imports.%Core
  57. // CHECK:STDOUT: .F = %F.decl
  58. // CHECK:STDOUT: }
  59. // CHECK:STDOUT: %Core.import = import Core
  60. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  61. // CHECK:STDOUT: }
  62. // CHECK:STDOUT:
  63. // CHECK:STDOUT: fn @F();
  64. // CHECK:STDOUT:
  65. // CHECK:STDOUT: --- import_raw_core.carbon
  66. // CHECK:STDOUT:
  67. // CHECK:STDOUT: constants {
  68. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  69. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  70. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  71. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  72. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  73. // CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
  74. // CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
  75. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  76. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  77. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  78. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  79. // CHECK:STDOUT: }
  80. // CHECK:STDOUT:
  81. // CHECK:STDOUT: imports {
  82. // CHECK:STDOUT: %Core.eced1c.1: <namespace> = namespace file.%Core.import.1, [concrete] {
  83. // CHECK:STDOUT: .Int = %Core.Int
  84. // CHECK:STDOUT: import Core//prelude
  85. // CHECK:STDOUT: import Core//prelude/...
  86. // CHECK:STDOUT: }
  87. // CHECK:STDOUT: %Core.eced1c.2: <namespace> = namespace file.%Core.import.loc4, [concrete] {
  88. // CHECK:STDOUT: .F = %Core.F
  89. // CHECK:STDOUT: import Core//default
  90. // CHECK:STDOUT: }
  91. // CHECK:STDOUT: %Core.F: %F.type = import_ref Core//default, F, loaded [concrete = constants.%F]
  92. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  93. // CHECK:STDOUT: }
  94. // CHECK:STDOUT:
  95. // CHECK:STDOUT: file {
  96. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  97. // CHECK:STDOUT: .Core = imports.%Core.eced1c.1
  98. // CHECK:STDOUT: .r#Core = imports.%Core.eced1c.2
  99. // CHECK:STDOUT: .G = %G.decl
  100. // CHECK:STDOUT: .H = %H.decl
  101. // CHECK:STDOUT: }
  102. // CHECK:STDOUT: %Core.import.1 = import Core
  103. // CHECK:STDOUT: %Core.import.loc4 = import r#Core
  104. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  105. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {} {}
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT:
  108. // CHECK:STDOUT: fn @G() {
  109. // CHECK:STDOUT: !entry:
  110. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref r#Core, imports.%Core.eced1c.2 [concrete = imports.%Core.eced1c.2]
  111. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Core.F [concrete = constants.%F]
  112. // CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.ref()
  113. // CHECK:STDOUT: return
  114. // CHECK:STDOUT: }
  115. // CHECK:STDOUT:
  116. // CHECK:STDOUT: fn @F [from "package_raw_core.carbon"];
  117. // CHECK:STDOUT:
  118. // CHECK:STDOUT: fn @H() {
  119. // CHECK:STDOUT: !entry:
  120. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core.eced1c.1 [concrete = imports.%Core.eced1c.1]
  121. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic]
  122. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  123. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  124. // CHECK:STDOUT: return
  125. // CHECK:STDOUT: }
  126. // CHECK:STDOUT:
  127. // CHECK:STDOUT: --- fail_raw_core_not_core.carbon
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: constants {
  130. // CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
  131. // CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
  132. // CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
  133. // CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
  134. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: imports {
  138. // CHECK:STDOUT: %Core.eced1c.1: <namespace> = namespace file.%Core.import.1, [concrete] {
  139. // CHECK:STDOUT: .F = <poisoned>
  140. // CHECK:STDOUT: import Core//prelude
  141. // CHECK:STDOUT: import Core//prelude/...
  142. // CHECK:STDOUT: }
  143. // CHECK:STDOUT: %Core.eced1c.2: <namespace> = namespace file.%Core.import.loc4, [concrete] {
  144. // CHECK:STDOUT: .Int = <poisoned>
  145. // CHECK:STDOUT: import Core//default
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT: }
  148. // CHECK:STDOUT:
  149. // CHECK:STDOUT: file {
  150. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  151. // CHECK:STDOUT: .Core = imports.%Core.eced1c.1
  152. // CHECK:STDOUT: .r#Core = imports.%Core.eced1c.2
  153. // CHECK:STDOUT: .G = %G.decl
  154. // CHECK:STDOUT: .H = %H.decl
  155. // CHECK:STDOUT: }
  156. // CHECK:STDOUT: %Core.import.1 = import Core
  157. // CHECK:STDOUT: %Core.import.loc4 = import r#Core
  158. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
  159. // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {} {}
  160. // CHECK:STDOUT: }
  161. // CHECK:STDOUT:
  162. // CHECK:STDOUT: fn @G() {
  163. // CHECK:STDOUT: !entry:
  164. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core.eced1c.1 [concrete = imports.%Core.eced1c.1]
  165. // CHECK:STDOUT: %F.ref: <error> = name_ref F, <error> [concrete = <error>]
  166. // CHECK:STDOUT: return
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: fn @H() {
  170. // CHECK:STDOUT: !entry:
  171. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref r#Core, imports.%Core.eced1c.2 [concrete = imports.%Core.eced1c.2]
  172. // CHECK:STDOUT: %Int.ref: <error> = name_ref Int, <error> [concrete = <error>]
  173. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  174. // CHECK:STDOUT: return
  175. // CHECK:STDOUT: }
  176. // CHECK:STDOUT:
  177. // CHECK:STDOUT: --- class_raw_core.carbon
  178. // CHECK:STDOUT:
  179. // CHECK:STDOUT: constants {
  180. // CHECK:STDOUT: %Core: type = class_type @Core [concrete]
  181. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  182. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  183. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  184. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  185. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  186. // CHECK:STDOUT: %Core.elem: type = unbound_element_type %Core, %i32 [concrete]
  187. // CHECK:STDOUT: %struct_type.n: type = struct_type {.n: %i32} [concrete]
  188. // CHECK:STDOUT: %complete_type.54b: <witness> = complete_type_witness %struct_type.n [concrete]
  189. // CHECK:STDOUT: %pattern_type.ddc: type = pattern_type %Core [concrete]
  190. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  191. // CHECK:STDOUT: %As.type.90f: type = generic_interface_type @As [concrete]
  192. // CHECK:STDOUT: %As.generic: %As.type.90f = struct_value () [concrete]
  193. // CHECK:STDOUT: %As.type.047: type = facet_type <@As, @As(%i32)> [concrete]
  194. // CHECK:STDOUT: %As.Convert.type.99b: type = fn_type @As.Convert, @As(%i32) [concrete]
  195. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  196. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.09e: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%To) [symbolic]
  197. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.dbe: %Core.IntLiteral.as.As.impl.Convert.type.09e = struct_value () [symbolic]
  198. // CHECK:STDOUT: %As.impl_witness.ab6: <witness> = impl_witness imports.%As.impl_witness_table.9fc, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  199. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.type.8ec: type = fn_type @Core.IntLiteral.as.As.impl.Convert, @Core.IntLiteral.as.As.impl(%int_32) [concrete]
  200. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.29b: %Core.IntLiteral.as.As.impl.Convert.type.8ec = struct_value () [concrete]
  201. // CHECK:STDOUT: %As.facet: %As.type.047 = facet_value Core.IntLiteral, (%As.impl_witness.ab6) [concrete]
  202. // CHECK:STDOUT: %.97a: type = fn_type_with_self_type %As.Convert.type.99b, %As.facet [concrete]
  203. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.bound: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.As.impl.Convert.29b [concrete]
  204. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.29b, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
  205. // CHECK:STDOUT: %bound_method.628: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
  206. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  207. // CHECK:STDOUT: %struct: %struct_type.n = struct_value (%int_0.6a9) [concrete]
  208. // CHECK:STDOUT: %.cb0: ref %i32 = class_element_access file.%c.var, element0 [concrete]
  209. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  210. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  211. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.824: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
  212. // CHECK:STDOUT: %Int.as.Copy.impl.Op.9b9: %Int.as.Copy.impl.Op.type.824 = struct_value () [symbolic]
  213. // CHECK:STDOUT: %Copy.impl_witness.f17: <witness> = impl_witness imports.%Copy.impl_witness_table.e76, @Int.as.Copy.impl(%int_32) [concrete]
  214. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.546: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
  215. // CHECK:STDOUT: %Int.as.Copy.impl.Op.664: %Int.as.Copy.impl.Op.type.546 = struct_value () [concrete]
  216. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.f17) [concrete]
  217. // CHECK:STDOUT: %.f79: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
  218. // CHECK:STDOUT: %Int.as.Copy.impl.Op.bound: <bound method> = bound_method %int_0.6a9, %Int.as.Copy.impl.Op.664 [concrete]
  219. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.664, @Int.as.Copy.impl.Op(%int_32) [concrete]
  220. // CHECK:STDOUT: %bound_method.5f6: <bound method> = bound_method %int_0.6a9, %Int.as.Copy.impl.Op.specific_fn [concrete]
  221. // CHECK:STDOUT: %Core.val: %Core = struct_value (%int_0.6a9) [concrete]
  222. // CHECK:STDOUT: }
  223. // CHECK:STDOUT:
  224. // CHECK:STDOUT: imports {
  225. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  226. // CHECK:STDOUT: .Int = %Core.Int
  227. // CHECK:STDOUT: .As = %Core.As
  228. // CHECK:STDOUT: .Copy = %Core.Copy
  229. // CHECK:STDOUT: import Core//prelude
  230. // CHECK:STDOUT: import Core//prelude/...
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  233. // CHECK:STDOUT: %Core.As: %As.type.90f = import_ref Core//prelude/parts/as, As, loaded [concrete = constants.%As.generic]
  234. // CHECK:STDOUT: %Core.import_ref.ca0: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.09e) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.dbe)]
  235. // CHECK:STDOUT: %As.impl_witness_table.9fc = impl_witness_table (%Core.import_ref.ca0), @Core.IntLiteral.as.As.impl [concrete]
  236. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  237. // CHECK:STDOUT: %Core.import_ref.18d: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.824) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.9b9)]
  238. // CHECK:STDOUT: %Copy.impl_witness_table.e76 = impl_witness_table (%Core.import_ref.18d), @Int.as.Copy.impl [concrete]
  239. // CHECK:STDOUT: }
  240. // CHECK:STDOUT:
  241. // CHECK:STDOUT: file {
  242. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  243. // CHECK:STDOUT: .Core = imports.%Core
  244. // CHECK:STDOUT: .r#Core = %Core.decl
  245. // CHECK:STDOUT: .c = %c
  246. // CHECK:STDOUT: }
  247. // CHECK:STDOUT: %Core.import = import Core
  248. // CHECK:STDOUT: %Core.decl: type = class_decl @Core [concrete = constants.%Core] {} {}
  249. // CHECK:STDOUT: name_binding_decl {
  250. // CHECK:STDOUT: %c.patt: %pattern_type.ddc = ref_binding_pattern c [concrete]
  251. // CHECK:STDOUT: %c.var_patt: %pattern_type.ddc = var_pattern %c.patt [concrete]
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT: %c.var: ref %Core = var %c.var_patt [concrete]
  254. // CHECK:STDOUT: %Core.ref: type = name_ref r#Core, %Core.decl [concrete = constants.%Core]
  255. // CHECK:STDOUT: %c: ref %Core = ref_binding c, %c.var [concrete = %c.var]
  256. // CHECK:STDOUT: }
  257. // CHECK:STDOUT:
  258. // CHECK:STDOUT: class @Core {
  259. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  260. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic]
  261. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  262. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  263. // CHECK:STDOUT: %.loc3: %Core.elem = field_decl n, element0 [concrete]
  264. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.n [concrete = constants.%complete_type.54b]
  265. // CHECK:STDOUT: complete_type_witness = %complete_type
  266. // CHECK:STDOUT:
  267. // CHECK:STDOUT: !members:
  268. // CHECK:STDOUT: .Self = constants.%Core
  269. // CHECK:STDOUT: .n = %.loc3
  270. // CHECK:STDOUT: }
  271. // CHECK:STDOUT:
  272. // CHECK:STDOUT: fn @__global_init() {
  273. // CHECK:STDOUT: !entry:
  274. // CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  275. // CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
  276. // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic]
  277. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  278. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  279. // CHECK:STDOUT: %impl.elem0.loc6_25.1: %.97a = impl_witness_access constants.%As.impl_witness.ab6, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.29b]
  280. // CHECK:STDOUT: %bound_method.loc6_25.1: <bound method> = bound_method %int_0, %impl.elem0.loc6_25.1 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
  281. // CHECK:STDOUT: %specific_fn.loc6_25.1: <specific function> = specific_function %impl.elem0.loc6_25.1, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
  282. // CHECK:STDOUT: %bound_method.loc6_25.2: <bound method> = bound_method %int_0, %specific_fn.loc6_25.1 [concrete = constants.%bound_method.628]
  283. // CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc6_25.2(%int_0) [concrete = constants.%int_0.6a9]
  284. // CHECK:STDOUT: %.loc6_25.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_0.6a9]
  285. // CHECK:STDOUT: %.loc6_25.2: %i32 = converted %int_0, %.loc6_25.1 [concrete = constants.%int_0.6a9]
  286. // CHECK:STDOUT: %.loc6_40.1: %struct_type.n = struct_literal (%.loc6_25.2) [concrete = constants.%struct]
  287. // CHECK:STDOUT: %impl.elem0.loc6_25.2: %.f79 = impl_witness_access constants.%Copy.impl_witness.f17, element0 [concrete = constants.%Int.as.Copy.impl.Op.664]
  288. // CHECK:STDOUT: %bound_method.loc6_25.3: <bound method> = bound_method %.loc6_25.2, %impl.elem0.loc6_25.2 [concrete = constants.%Int.as.Copy.impl.Op.bound]
  289. // CHECK:STDOUT: %specific_fn.loc6_25.2: <specific function> = specific_function %impl.elem0.loc6_25.2, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  290. // CHECK:STDOUT: %bound_method.loc6_25.4: <bound method> = bound_method %.loc6_25.2, %specific_fn.loc6_25.2 [concrete = constants.%bound_method.5f6]
  291. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc6_25.4(%.loc6_25.2) [concrete = constants.%int_0.6a9]
  292. // CHECK:STDOUT: %.loc6_40.2: ref %i32 = class_element_access file.%c.var, element0 [concrete = constants.%.cb0]
  293. // CHECK:STDOUT: %.loc6_40.3: init %i32 = initialize_from %Int.as.Copy.impl.Op.call to %.loc6_40.2 [concrete = constants.%int_0.6a9]
  294. // CHECK:STDOUT: %.loc6_40.4: init %Core = class_init (%.loc6_40.3), file.%c.var [concrete = constants.%Core.val]
  295. // CHECK:STDOUT: %.loc6_1: init %Core = converted %.loc6_40.1, %.loc6_40.4 [concrete = constants.%Core.val]
  296. // CHECK:STDOUT: assign file.%c.var, %.loc6_1
  297. // CHECK:STDOUT: return
  298. // CHECK:STDOUT: }
  299. // CHECK:STDOUT: