field_access.carbon 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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/class/field_access.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/field_access.carbon
  14. class Class {
  15. var j: i32;
  16. var k: i32;
  17. }
  18. fn Run() {
  19. var c: Class;
  20. c.j = 1;
  21. c.k = 2;
  22. var cj: i32 = c.j;
  23. var ck: i32 = c.k;
  24. }
  25. // CHECK:STDOUT: --- field_access.carbon
  26. // CHECK:STDOUT:
  27. // CHECK:STDOUT: constants {
  28. // CHECK:STDOUT: %Class: type = class_type @Class [concrete]
  29. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  30. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  31. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  32. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  33. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  34. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  35. // CHECK:STDOUT: %Class.elem: type = unbound_element_type %Class, %i32 [concrete]
  36. // CHECK:STDOUT: %struct_type.j.k: type = struct_type {.j: %i32, .k: %i32} [concrete]
  37. // CHECK:STDOUT: %complete_type.cf7: <witness> = complete_type_witness %struct_type.j.k [concrete]
  38. // CHECK:STDOUT: %Run.type: type = fn_type @Run [concrete]
  39. // CHECK:STDOUT: %Run: %Run.type = struct_value () [concrete]
  40. // CHECK:STDOUT: %pattern_type.761: type = pattern_type %Class [concrete]
  41. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
  42. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  43. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  44. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  45. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  46. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  47. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  48. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51 = struct_value () [symbolic]
  49. // CHECK:STDOUT: %ImplicitAs.impl_witness.bc9: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.132, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  50. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  51. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e = struct_value () [concrete]
  52. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.bc9) [concrete]
  53. // CHECK:STDOUT: %.322: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  54. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.265: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [concrete]
  55. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  56. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  57. // CHECK:STDOUT: %bound_method.dfc: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  58. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
  59. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  60. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.393: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [concrete]
  61. // CHECK:STDOUT: %bound_method.9f7: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  62. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  63. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  64. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  65. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.24b: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
  66. // CHECK:STDOUT: %Int.as.Copy.impl.Op.c95: %Int.as.Copy.impl.Op.type.24b = struct_value () [symbolic]
  67. // CHECK:STDOUT: %Copy.impl_witness.fb7: <witness> = impl_witness imports.%Copy.impl_witness_table.b6a, @Int.as.Copy.impl(%int_32) [concrete]
  68. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.469: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
  69. // CHECK:STDOUT: %Int.as.Copy.impl.Op.dfd: %Int.as.Copy.impl.Op.type.469 = struct_value () [concrete]
  70. // CHECK:STDOUT: %Copy.facet: %Copy.type = facet_value %i32, (%Copy.impl_witness.fb7) [concrete]
  71. // CHECK:STDOUT: %.65f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet [concrete]
  72. // CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.dfd, @Int.as.Copy.impl.Op(%int_32) [concrete]
  73. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  74. // CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
  75. // CHECK:STDOUT: %facet_value.d23: %type_where = facet_value %i32, () [concrete]
  76. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d4e: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d23) [concrete]
  77. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.424: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.d4e = struct_value () [concrete]
  78. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.c20: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.424, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.d23) [concrete]
  79. // CHECK:STDOUT: %facet_value.d3d: %type_where = facet_value %Class, () [concrete]
  80. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e99: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.d3d) [concrete]
  81. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.378: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.e99 = struct_value () [concrete]
  82. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2f5: <specific function> = specific_function %DestroyT.binding.as_type.as.Destroy.impl.Op.378, @DestroyT.binding.as_type.as.Destroy.impl.Op(%facet_value.d3d) [concrete]
  83. // CHECK:STDOUT: }
  84. // CHECK:STDOUT:
  85. // CHECK:STDOUT: imports {
  86. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  87. // CHECK:STDOUT: .Int = %Core.Int
  88. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  89. // CHECK:STDOUT: .Copy = %Core.Copy
  90. // CHECK:STDOUT: .Destroy = %Core.Destroy
  91. // CHECK:STDOUT: import Core//prelude
  92. // CHECK:STDOUT: import Core//prelude/...
  93. // CHECK:STDOUT: }
  94. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  95. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  96. // CHECK:STDOUT: %Core.import_ref.e24: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1)]
  97. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.132 = impl_witness_table (%Core.import_ref.e24), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  98. // CHECK:STDOUT: %Core.Copy: type = import_ref Core//prelude/parts/copy, Copy, loaded [concrete = constants.%Copy.type]
  99. // CHECK:STDOUT: %Core.import_ref.d12: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.24b) = 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.c95)]
  100. // CHECK:STDOUT: %Copy.impl_witness_table.b6a = impl_witness_table (%Core.import_ref.d12), @Int.as.Copy.impl [concrete]
  101. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  102. // CHECK:STDOUT: }
  103. // CHECK:STDOUT:
  104. // CHECK:STDOUT: file {
  105. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  106. // CHECK:STDOUT: .Core = imports.%Core
  107. // CHECK:STDOUT: .Class = %Class.decl
  108. // CHECK:STDOUT: .Run = %Run.decl
  109. // CHECK:STDOUT: }
  110. // CHECK:STDOUT: %Core.import = import Core
  111. // CHECK:STDOUT: %Class.decl: type = class_decl @Class [concrete = constants.%Class] {} {}
  112. // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [concrete = constants.%Run] {} {}
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: class @Class {
  116. // CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  117. // CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  118. // CHECK:STDOUT: %.loc16: %Class.elem = field_decl j, element0 [concrete]
  119. // CHECK:STDOUT: %int_32.loc17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  120. // CHECK:STDOUT: %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  121. // CHECK:STDOUT: %.loc17: %Class.elem = field_decl k, element1 [concrete]
  122. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.j.k [concrete = constants.%complete_type.cf7]
  123. // CHECK:STDOUT: complete_type_witness = %complete_type
  124. // CHECK:STDOUT:
  125. // CHECK:STDOUT: !members:
  126. // CHECK:STDOUT: .Self = constants.%Class
  127. // CHECK:STDOUT: .j = %.loc16
  128. // CHECK:STDOUT: .k = %.loc17
  129. // CHECK:STDOUT: }
  130. // CHECK:STDOUT:
  131. // CHECK:STDOUT: fn @Run() {
  132. // CHECK:STDOUT: !entry:
  133. // CHECK:STDOUT: name_binding_decl {
  134. // CHECK:STDOUT: %c.patt: %pattern_type.761 = ref_binding_pattern c [concrete]
  135. // CHECK:STDOUT: %c.var_patt: %pattern_type.761 = var_pattern %c.patt [concrete]
  136. // CHECK:STDOUT: }
  137. // CHECK:STDOUT: %c.var: ref %Class = var %c.var_patt
  138. // CHECK:STDOUT: %Class.ref: type = name_ref Class, file.%Class.decl [concrete = constants.%Class]
  139. // CHECK:STDOUT: %c: ref %Class = ref_binding c, %c.var
  140. // CHECK:STDOUT: %c.ref.loc22: ref %Class = name_ref c, %c
  141. // CHECK:STDOUT: %j.ref.loc22: %Class.elem = name_ref j, @Class.%.loc16 [concrete = @Class.%.loc16]
  142. // CHECK:STDOUT: %.loc22_4: ref %i32 = class_element_access %c.ref.loc22, element0
  143. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
  144. // CHECK:STDOUT: %impl.elem0.loc22: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  145. // CHECK:STDOUT: %bound_method.loc22_7.1: <bound method> = bound_method %int_1, %impl.elem0.loc22 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.265]
  146. // CHECK:STDOUT: %specific_fn.loc22: <specific function> = specific_function %impl.elem0.loc22, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  147. // CHECK:STDOUT: %bound_method.loc22_7.2: <bound method> = bound_method %int_1, %specific_fn.loc22 [concrete = constants.%bound_method.dfc]
  148. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22: init %i32 = call %bound_method.loc22_7.2(%int_1) [concrete = constants.%int_1.5d2]
  149. // CHECK:STDOUT: %.loc22_7: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc22 [concrete = constants.%int_1.5d2]
  150. // CHECK:STDOUT: assign %.loc22_4, %.loc22_7
  151. // CHECK:STDOUT: %c.ref.loc23: ref %Class = name_ref c, %c
  152. // CHECK:STDOUT: %k.ref.loc23: %Class.elem = name_ref k, @Class.%.loc17 [concrete = @Class.%.loc17]
  153. // CHECK:STDOUT: %.loc23_4: ref %i32 = class_element_access %c.ref.loc23, element1
  154. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  155. // CHECK:STDOUT: %impl.elem0.loc23: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  156. // CHECK:STDOUT: %bound_method.loc23_7.1: <bound method> = bound_method %int_2, %impl.elem0.loc23 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.393]
  157. // CHECK:STDOUT: %specific_fn.loc23: <specific function> = specific_function %impl.elem0.loc23, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  158. // CHECK:STDOUT: %bound_method.loc23_7.2: <bound method> = bound_method %int_2, %specific_fn.loc23 [concrete = constants.%bound_method.9f7]
  159. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23: init %i32 = call %bound_method.loc23_7.2(%int_2) [concrete = constants.%int_2.ef8]
  160. // CHECK:STDOUT: %.loc23_7: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc23 [concrete = constants.%int_2.ef8]
  161. // CHECK:STDOUT: assign %.loc23_4, %.loc23_7
  162. // CHECK:STDOUT: name_binding_decl {
  163. // CHECK:STDOUT: %cj.patt: %pattern_type.7ce = ref_binding_pattern cj [concrete]
  164. // CHECK:STDOUT: %cj.var_patt: %pattern_type.7ce = var_pattern %cj.patt [concrete]
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT: %cj.var: ref %i32 = var %cj.var_patt
  167. // CHECK:STDOUT: %c.ref.loc24: ref %Class = name_ref c, %c
  168. // CHECK:STDOUT: %j.ref.loc24: %Class.elem = name_ref j, @Class.%.loc16 [concrete = @Class.%.loc16]
  169. // CHECK:STDOUT: %.loc24_18.1: ref %i32 = class_element_access %c.ref.loc24, element0
  170. // CHECK:STDOUT: %.loc24_18.2: %i32 = acquire_value %.loc24_18.1
  171. // CHECK:STDOUT: %impl.elem0.loc24: %.65f = impl_witness_access constants.%Copy.impl_witness.fb7, element0 [concrete = constants.%Int.as.Copy.impl.Op.dfd]
  172. // CHECK:STDOUT: %bound_method.loc24_18.1: <bound method> = bound_method %.loc24_18.2, %impl.elem0.loc24
  173. // CHECK:STDOUT: %specific_fn.loc24: <specific function> = specific_function %impl.elem0.loc24, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  174. // CHECK:STDOUT: %bound_method.loc24_18.2: <bound method> = bound_method %.loc24_18.2, %specific_fn.loc24
  175. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc24: init %i32 = call %bound_method.loc24_18.2(%.loc24_18.2)
  176. // CHECK:STDOUT: assign %cj.var, %Int.as.Copy.impl.Op.call.loc24
  177. // CHECK:STDOUT: %.loc24_11: type = splice_block %i32.loc24 [concrete = constants.%i32] {
  178. // CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  179. // CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  180. // CHECK:STDOUT: }
  181. // CHECK:STDOUT: %cj: ref %i32 = ref_binding cj, %cj.var
  182. // CHECK:STDOUT: name_binding_decl {
  183. // CHECK:STDOUT: %ck.patt: %pattern_type.7ce = ref_binding_pattern ck [concrete]
  184. // CHECK:STDOUT: %ck.var_patt: %pattern_type.7ce = var_pattern %ck.patt [concrete]
  185. // CHECK:STDOUT: }
  186. // CHECK:STDOUT: %ck.var: ref %i32 = var %ck.var_patt
  187. // CHECK:STDOUT: %c.ref.loc25: ref %Class = name_ref c, %c
  188. // CHECK:STDOUT: %k.ref.loc25: %Class.elem = name_ref k, @Class.%.loc17 [concrete = @Class.%.loc17]
  189. // CHECK:STDOUT: %.loc25_18.1: ref %i32 = class_element_access %c.ref.loc25, element1
  190. // CHECK:STDOUT: %.loc25_18.2: %i32 = acquire_value %.loc25_18.1
  191. // CHECK:STDOUT: %impl.elem0.loc25: %.65f = impl_witness_access constants.%Copy.impl_witness.fb7, element0 [concrete = constants.%Int.as.Copy.impl.Op.dfd]
  192. // CHECK:STDOUT: %bound_method.loc25_18.1: <bound method> = bound_method %.loc25_18.2, %impl.elem0.loc25
  193. // CHECK:STDOUT: %specific_fn.loc25: <specific function> = specific_function %impl.elem0.loc25, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  194. // CHECK:STDOUT: %bound_method.loc25_18.2: <bound method> = bound_method %.loc25_18.2, %specific_fn.loc25
  195. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call.loc25: init %i32 = call %bound_method.loc25_18.2(%.loc25_18.2)
  196. // CHECK:STDOUT: assign %ck.var, %Int.as.Copy.impl.Op.call.loc25
  197. // CHECK:STDOUT: %.loc25_11: type = splice_block %i32.loc25 [concrete = constants.%i32] {
  198. // CHECK:STDOUT: %int_32.loc25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
  199. // CHECK:STDOUT: %i32.loc25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
  200. // CHECK:STDOUT: }
  201. // CHECK:STDOUT: %ck: ref %i32 = ref_binding ck, %ck.var
  202. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc25: <bound method> = bound_method %ck.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.424
  203. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.424, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.d23) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.c20]
  204. // CHECK:STDOUT: %bound_method.loc25_3: <bound method> = bound_method %ck.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
  205. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25_3(%ck.var)
  206. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc24: <bound method> = bound_method %cj.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.424
  207. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.424, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.d23) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.c20]
  208. // CHECK:STDOUT: %bound_method.loc24_3: <bound method> = bound_method %cj.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
  209. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24_3(%cj.var)
  210. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc21: <bound method> = bound_method %c.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.378
  211. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3: <specific function> = specific_function constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.378, @DestroyT.binding.as_type.as.Destroy.impl.Op(constants.%facet_value.d3d) [concrete = constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2f5]
  212. // CHECK:STDOUT: %bound_method.loc21: <bound method> = bound_method %c.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.3
  213. // CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc21: init %empty_tuple.type = call %bound_method.loc21(%c.var)
  214. // CHECK:STDOUT: return
  215. // CHECK:STDOUT: }
  216. // CHECK:STDOUT: