template.carbon 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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. //
  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/interop/cpp/class/template.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/class/template.carbon
  12. // --- class_template.h
  13. struct Base {};
  14. template<typename T> struct A : Base {
  15. void f() const;
  16. T n;
  17. };
  18. using Aint = A<int>;
  19. using Along = A<long>;
  20. // --- use_class_template.carbon
  21. library "[[@TEST_NAME]]";
  22. import Cpp library "class_template.h";
  23. fn F(x: Cpp.Aint) -> i32 {
  24. // Trigger instantiation through name lookup.
  25. //@dump-sem-ir-begin
  26. x.f();
  27. return x.n;
  28. //@dump-sem-ir-end
  29. }
  30. fn G(p: Cpp.Along*) -> Cpp.Base* {
  31. // Trigger instantiation through type completion.
  32. //@dump-sem-ir-begin
  33. return p;
  34. //@dump-sem-ir-end
  35. }
  36. // --- instantiation_error.h
  37. template<typename T> struct X {
  38. using type = typename T::member;
  39. };
  40. struct Y {
  41. using member = int;
  42. };
  43. using XY = X<Y>;
  44. using Xint = X<int>;
  45. // --- fail_use_instantiation_error.carbon
  46. library "[[@TEST_NAME]]";
  47. // CHECK:STDERR: fail_use_instantiation_error.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
  48. // CHECK:STDERR: ./instantiation_error.h:3:25: error: type 'int' cannot be used prior to '::' because it has no members [CppInteropParseError]
  49. // CHECK:STDERR: 3 | using type = typename T::member;
  50. // CHECK:STDERR: | ^
  51. // CHECK:STDERR: fail_use_instantiation_error.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
  52. // CHECK:STDERR: ./instantiation_error.h:2:29: note: in instantiation of template class 'X<int>' requested here [CppInteropParseNote]
  53. // CHECK:STDERR: 2 | template<typename T> struct X {
  54. // CHECK:STDERR: | ^
  55. import Cpp library "instantiation_error.h";
  56. //@dump-sem-ir-begin
  57. var x: Cpp.XY.r#type = 0;
  58. // CHECK:STDERR: fail_use_instantiation_error.carbon:[[@LINE+4]]:8: note: while completing C++ type `Cpp.X` [InCppTypeCompletion]
  59. // CHECK:STDERR: var y: Cpp.Xint.r#type = 0;
  60. // CHECK:STDERR: ^~~~~~~~~~~~~
  61. // CHECK:STDERR:
  62. var y: Cpp.Xint.r#type = 0;
  63. //@dump-sem-ir-end
  64. // CHECK:STDOUT: --- use_class_template.carbon
  65. // CHECK:STDOUT:
  66. // CHECK:STDOUT: constants {
  67. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  68. // CHECK:STDOUT: %A.0bedf0.1: type = class_type @A.1 [concrete]
  69. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  70. // CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
  71. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  72. // CHECK:STDOUT: %Base: type = class_type @Base [concrete]
  73. // CHECK:STDOUT: %A.elem.c3f: type = unbound_element_type %A.0bedf0.1, %i32 [concrete]
  74. // CHECK:STDOUT: %A.f.cpp_overload_set.type: type = cpp_overload_set_type @A.f.cpp_overload_set [concrete]
  75. // CHECK:STDOUT: %A.f.cpp_overload_set.value: %A.f.cpp_overload_set.type = cpp_overload_set_value @A.f.cpp_overload_set [concrete]
  76. // CHECK:STDOUT: %f__carbon_thunk.type: type = fn_type @f__carbon_thunk [concrete]
  77. // CHECK:STDOUT: %f__carbon_thunk: %f__carbon_thunk.type = struct_value () [concrete]
  78. // CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
  79. // CHECK:STDOUT: %Copy.Op.type: type = fn_type @Copy.Op [concrete]
  80. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.24b: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
  81. // CHECK:STDOUT: %Int.as.Copy.impl.Op.c95: %Int.as.Copy.impl.Op.type.24b = struct_value () [symbolic]
  82. // CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic]
  83. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.75b: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%T.d9f) [symbolic]
  84. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.692: %ptr.as.Copy.impl.Op.type.75b = struct_value () [symbolic]
  85. // CHECK:STDOUT: %Copy.impl_witness.fb7: <witness> = impl_witness imports.%Copy.impl_witness_table.b6a, @Int.as.Copy.impl(%int_32) [concrete]
  86. // CHECK:STDOUT: %Int.as.Copy.impl.Op.type.469: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%int_32) [concrete]
  87. // CHECK:STDOUT: %Int.as.Copy.impl.Op.dfd: %Int.as.Copy.impl.Op.type.469 = struct_value () [concrete]
  88. // CHECK:STDOUT: %Copy.facet.c50: %Copy.type = facet_value %i32, (%Copy.impl_witness.fb7) [concrete]
  89. // CHECK:STDOUT: %.65f: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.c50 [concrete]
  90. // 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]
  91. // CHECK:STDOUT: %A.0bedf0.2: type = class_type @A.2 [concrete]
  92. // CHECK:STDOUT: %ptr.270: type = ptr_type %A.0bedf0.2 [concrete]
  93. // CHECK:STDOUT: %ptr.fb2: type = ptr_type %Base [concrete]
  94. // CHECK:STDOUT: %Copy.impl_witness.dec: <witness> = impl_witness imports.%Copy.impl_witness_table.67d, @ptr.as.Copy.impl(%Base) [concrete]
  95. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.type.9d2: type = fn_type @ptr.as.Copy.impl.Op, @ptr.as.Copy.impl(%Base) [concrete]
  96. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.ba1: %ptr.as.Copy.impl.Op.type.9d2 = struct_value () [concrete]
  97. // CHECK:STDOUT: %Copy.facet.9a1: %Copy.type = facet_value %ptr.fb2, (%Copy.impl_witness.dec) [concrete]
  98. // CHECK:STDOUT: %.30c: type = fn_type_with_self_type %Copy.Op.type, %Copy.facet.9a1 [concrete]
  99. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %ptr.as.Copy.impl.Op.ba1, @ptr.as.Copy.impl.Op(%Base) [concrete]
  100. // CHECK:STDOUT: }
  101. // CHECK:STDOUT:
  102. // CHECK:STDOUT: imports {
  103. // CHECK:STDOUT: %A.f.cpp_overload_set.value: %A.f.cpp_overload_set.type = cpp_overload_set_value @A.f.cpp_overload_set [concrete = constants.%A.f.cpp_overload_set.value]
  104. // CHECK:STDOUT: %f__carbon_thunk.decl: %f__carbon_thunk.type = fn_decl @f__carbon_thunk [concrete = constants.%f__carbon_thunk] {
  105. // CHECK:STDOUT: <elided>
  106. // CHECK:STDOUT: } {
  107. // CHECK:STDOUT: <elided>
  108. // CHECK:STDOUT: }
  109. // 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)]
  110. // CHECK:STDOUT: %Copy.impl_witness_table.b6a = impl_witness_table (%Core.import_ref.d12), @Int.as.Copy.impl [concrete]
  111. // CHECK:STDOUT: %Core.import_ref.659: @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op.type (%ptr.as.Copy.impl.Op.type.75b) = import_ref Core//prelude/parts/copy, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.Copy.impl.%ptr.as.Copy.impl.Op (constants.%ptr.as.Copy.impl.Op.692)]
  112. // CHECK:STDOUT: %Copy.impl_witness_table.67d = impl_witness_table (%Core.import_ref.659), @ptr.as.Copy.impl [concrete]
  113. // CHECK:STDOUT: }
  114. // CHECK:STDOUT:
  115. // CHECK:STDOUT: fn @F(%x.param: %A.0bedf0.1) -> %i32 {
  116. // CHECK:STDOUT: !entry:
  117. // CHECK:STDOUT: %x.ref.loc9: %A.0bedf0.1 = name_ref x, %x
  118. // CHECK:STDOUT: %f.ref: %A.f.cpp_overload_set.type = name_ref f, imports.%A.f.cpp_overload_set.value [concrete = constants.%A.f.cpp_overload_set.value]
  119. // CHECK:STDOUT: %bound_method.loc9: <bound method> = bound_method %x.ref.loc9, %f.ref
  120. // CHECK:STDOUT: %f__carbon_thunk.call: init %empty_tuple.type = call imports.%f__carbon_thunk.decl(%x.ref.loc9)
  121. // CHECK:STDOUT: %x.ref.loc10: %A.0bedf0.1 = name_ref x, %x
  122. // CHECK:STDOUT: %n.ref: %A.elem.c3f = name_ref n, @A.1.%.2 [concrete = @A.1.%.2]
  123. // CHECK:STDOUT: %.loc10_11.1: ref %i32 = class_element_access %x.ref.loc10, element1
  124. // CHECK:STDOUT: %.loc10_11.2: %i32 = acquire_value %.loc10_11.1
  125. // CHECK:STDOUT: %impl.elem0: %.65f = impl_witness_access constants.%Copy.impl_witness.fb7, element0 [concrete = constants.%Int.as.Copy.impl.Op.dfd]
  126. // CHECK:STDOUT: %bound_method.loc10_11.1: <bound method> = bound_method %.loc10_11.2, %impl.elem0
  127. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
  128. // CHECK:STDOUT: %bound_method.loc10_11.2: <bound method> = bound_method %.loc10_11.2, %specific_fn
  129. // CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc10_11.2(%.loc10_11.2)
  130. // CHECK:STDOUT: return %Int.as.Copy.impl.Op.call to %return
  131. // CHECK:STDOUT: }
  132. // CHECK:STDOUT:
  133. // CHECK:STDOUT: fn @G(%p.param: %ptr.270) -> %ptr.fb2 {
  134. // CHECK:STDOUT: !entry:
  135. // CHECK:STDOUT: %p.ref: %ptr.270 = name_ref p, %p
  136. // CHECK:STDOUT: %.loc17_11.1: ref %A.0bedf0.2 = deref %p.ref
  137. // CHECK:STDOUT: %.loc17_11.2: ref %Base = class_element_access %.loc17_11.1, element0
  138. // CHECK:STDOUT: %addr: %ptr.fb2 = addr_of %.loc17_11.2
  139. // CHECK:STDOUT: %.loc17_11.3: %ptr.fb2 = converted %p.ref, %addr
  140. // CHECK:STDOUT: %impl.elem0: %.30c = impl_witness_access constants.%Copy.impl_witness.dec, element0 [concrete = constants.%ptr.as.Copy.impl.Op.ba1]
  141. // CHECK:STDOUT: %bound_method.loc17_11.1: <bound method> = bound_method %.loc17_11.3, %impl.elem0
  142. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @ptr.as.Copy.impl.Op(constants.%Base) [concrete = constants.%ptr.as.Copy.impl.Op.specific_fn]
  143. // CHECK:STDOUT: %bound_method.loc17_11.2: <bound method> = bound_method %.loc17_11.3, %specific_fn
  144. // CHECK:STDOUT: %ptr.as.Copy.impl.Op.call: init %ptr.fb2 = call %bound_method.loc17_11.2(%.loc17_11.3)
  145. // CHECK:STDOUT: return %ptr.as.Copy.impl.Op.call to %return
  146. // CHECK:STDOUT: }
  147. // CHECK:STDOUT:
  148. // CHECK:STDOUT: --- fail_use_instantiation_error.carbon
  149. // CHECK:STDOUT:
  150. // CHECK:STDOUT: constants {
  151. // CHECK:STDOUT: %X.32d59e.1: type = class_type @X.1 [concrete]
  152. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  153. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  154. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  155. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
  156. // CHECK:STDOUT: %ImplicitAs.type.d14: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  157. // CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
  158. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  159. // 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]
  160. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.2a1: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.f51 = struct_value () [symbolic]
  161. // CHECK:STDOUT: %ImplicitAs.impl_witness.bc9: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.132, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  162. // 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]
  163. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.51e = struct_value () [concrete]
  164. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.d14 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.bc9) [concrete]
  165. // CHECK:STDOUT: %.322: type = fn_type_with_self_type %ImplicitAs.Convert.type.1b6, %ImplicitAs.facet [concrete]
  166. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b [concrete]
  167. // 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]
  168. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  169. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
  170. // CHECK:STDOUT: %X.32d59e.2: type = class_type @X.2 [concrete]
  171. // CHECK:STDOUT: }
  172. // CHECK:STDOUT:
  173. // CHECK:STDOUT: imports {
  174. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  175. // CHECK:STDOUT: .XY = %X.decl.dec4cb.1
  176. // CHECK:STDOUT: .Xint = %X.decl.dec4cb.2
  177. // CHECK:STDOUT: import Cpp//...
  178. // CHECK:STDOUT: }
  179. // CHECK:STDOUT: %X.decl.dec4cb.1: type = class_decl @X.1 [concrete = constants.%X.32d59e.1] {} {}
  180. // 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)]
  181. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.132 = impl_witness_table (%Core.import_ref.e24), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  182. // CHECK:STDOUT: %X.decl.dec4cb.2: type = class_decl @X.2 [concrete = constants.%X.32d59e.2] {} {}
  183. // CHECK:STDOUT: }
  184. // CHECK:STDOUT:
  185. // CHECK:STDOUT: file {
  186. // CHECK:STDOUT: name_binding_decl {
  187. // CHECK:STDOUT: %x.patt: %pattern_type.7ce = ref_binding_pattern x [concrete]
  188. // CHECK:STDOUT: %x.var_patt: %pattern_type.7ce = var_pattern %x.patt [concrete]
  189. // CHECK:STDOUT: }
  190. // CHECK:STDOUT: %x.var: ref %i32 = var %x.var_patt [concrete]
  191. // CHECK:STDOUT: %.loc15: type = splice_block %type.ref.loc15 [concrete = constants.%i32] {
  192. // CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  193. // CHECK:STDOUT: %XY.ref: type = name_ref XY, imports.%X.decl.dec4cb.1 [concrete = constants.%X.32d59e.1]
  194. // CHECK:STDOUT: <elided>
  195. // CHECK:STDOUT: %type.ref.loc15: type = name_ref r#type, %i32.2 [concrete = constants.%i32]
  196. // CHECK:STDOUT: }
  197. // CHECK:STDOUT: %x: ref %i32 = ref_binding x, %x.var [concrete = %x.var]
  198. // CHECK:STDOUT: name_binding_decl {
  199. // CHECK:STDOUT: %y.patt: %pattern_type.7ce = ref_binding_pattern y [concrete]
  200. // CHECK:STDOUT: %y.var_patt: %pattern_type.7ce = var_pattern %y.patt [concrete]
  201. // CHECK:STDOUT: }
  202. // CHECK:STDOUT: %y.var: ref %i32 = var %y.var_patt [concrete]
  203. // CHECK:STDOUT: %.loc21: type = splice_block %type.ref.loc21 [concrete = constants.%i32] {
  204. // CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
  205. // CHECK:STDOUT: %Xint.ref: type = name_ref Xint, imports.%X.decl.dec4cb.2 [concrete = constants.%X.32d59e.2]
  206. // CHECK:STDOUT: <elided>
  207. // CHECK:STDOUT: %type.ref.loc21: type = name_ref r#type, %i32.1 [concrete = constants.%i32]
  208. // CHECK:STDOUT: }
  209. // CHECK:STDOUT: %y: ref %i32 = ref_binding y, %y.var [concrete = %y.var]
  210. // CHECK:STDOUT: }
  211. // CHECK:STDOUT:
  212. // CHECK:STDOUT: fn @__global_init() {
  213. // CHECK:STDOUT: !entry:
  214. // CHECK:STDOUT: %int_0.loc15: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  215. // CHECK:STDOUT: %impl.elem0.loc15: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  216. // CHECK:STDOUT: %bound_method.loc15_1.1: <bound method> = bound_method %int_0.loc15, %impl.elem0.loc15 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  217. // CHECK:STDOUT: %specific_fn.loc15: <specific function> = specific_function %impl.elem0.loc15, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  218. // CHECK:STDOUT: %bound_method.loc15_1.2: <bound method> = bound_method %int_0.loc15, %specific_fn.loc15 [concrete = constants.%bound_method]
  219. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15: init %i32 = call %bound_method.loc15_1.2(%int_0.loc15) [concrete = constants.%int_0.6a9]
  220. // CHECK:STDOUT: %.loc15: init %i32 = converted %int_0.loc15, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc15 [concrete = constants.%int_0.6a9]
  221. // CHECK:STDOUT: assign file.%x.var, %.loc15
  222. // CHECK:STDOUT: %int_0.loc21: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
  223. // CHECK:STDOUT: %impl.elem0.loc21: %.322 = impl_witness_access constants.%ImplicitAs.impl_witness.bc9, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e9b]
  224. // CHECK:STDOUT: %bound_method.loc21_1.1: <bound method> = bound_method %int_0.loc21, %impl.elem0.loc21 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  225. // CHECK:STDOUT: %specific_fn.loc21: <specific function> = specific_function %impl.elem0.loc21, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  226. // CHECK:STDOUT: %bound_method.loc21_1.2: <bound method> = bound_method %int_0.loc21, %specific_fn.loc21 [concrete = constants.%bound_method]
  227. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21: init %i32 = call %bound_method.loc21_1.2(%int_0.loc21) [concrete = constants.%int_0.6a9]
  228. // CHECK:STDOUT: %.loc21: init %i32 = converted %int_0.loc21, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc21 [concrete = constants.%int_0.6a9]
  229. // CHECK:STDOUT: assign file.%y.var, %.loc21
  230. // CHECK:STDOUT: <elided>
  231. // CHECK:STDOUT: }
  232. // CHECK:STDOUT: