import.carbon 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  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/tuple/import.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/import.carbon
  10. // --- implicit.carbon
  11. package Implicit;
  12. var a_ref: (i32,) = (0,);
  13. var b_ref: (((i32,), i32), (i32, i32)) = (((0,), 1), (2, 3));
  14. class C(X:! (i32, i32)) {}
  15. fn F() -> C((1, 2));
  16. // --- implicit.impl.carbon
  17. impl package Implicit;
  18. var a: (i32,) = a_ref;
  19. var b: (((i32,), i32), (i32, i32)) = b_ref;
  20. var c: C((1, 2)) = F();
  21. // --- fail_bad_type.impl.carbon
  22. impl package Implicit;
  23. // CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+8]]:14: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch]
  24. // CHECK:STDERR: var c_bad: C((1, 2, 3)) = F();
  25. // CHECK:STDERR: ^~~~~~~~~
  26. // CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE-5]]:6: in import [InImport]
  27. // CHECK:STDERR: implicit.carbon:7:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  28. // CHECK:STDERR: class C(X:! (i32, i32)) {}
  29. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
  30. // CHECK:STDERR:
  31. var c_bad: C((1, 2, 3)) = F();
  32. // --- fail_bad_value.impl.carbon
  33. impl package Implicit;
  34. // CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C((1, 2))` to `C((3, 4))` [ImplicitAsConversionFailure]
  35. // CHECK:STDERR: var c_bad: C((3, 4)) = F();
  36. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  37. // CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+4]]:1: note: type `C((1, 2))` does not implement interface `Core.ImplicitAs(C((3, 4)))` [MissingImplInMemberAccessNote]
  38. // CHECK:STDERR: var c_bad: C((3, 4)) = F();
  39. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
  40. // CHECK:STDERR:
  41. var c_bad: C((3, 4)) = F();
  42. // CHECK:STDOUT: --- implicit.carbon
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: constants {
  45. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  46. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  47. // CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [template]
  48. // CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template]
  49. // CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
  50. // CHECK:STDOUT: %tuple.type.985: type = tuple_type (Core.IntLiteral) [template]
  51. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  52. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  53. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
  54. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  55. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
  56. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
  57. // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
  58. // CHECK:STDOUT: %Convert.bound.d04: <bound method> = bound_method %int_0.5c6, %Convert.956 [template]
  59. // CHECK:STDOUT: %Convert.specific_fn.d62: <specific function> = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template]
  60. // CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
  61. // CHECK:STDOUT: %tuple.592: %tuple.type.a1c = tuple_value (%int_0.6a9) [template]
  62. // CHECK:STDOUT: %tuple.type.8c7: type = tuple_type (%tuple.type.85c, type) [template]
  63. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
  64. // CHECK:STDOUT: %tuple.type.58c: type = tuple_type (%tuple.type.8c7, %tuple.type.24b) [template]
  65. // CHECK:STDOUT: %tuple.type.fe6: type = tuple_type (%tuple.type.a1c, %i32) [template]
  66. // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [template]
  67. // CHECK:STDOUT: %tuple.type.fc1: type = tuple_type (%tuple.type.fe6, %tuple.type.d07) [template]
  68. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
  69. // CHECK:STDOUT: %tuple.type.186: type = tuple_type (%tuple.type.985, Core.IntLiteral) [template]
  70. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  71. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
  72. // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  73. // CHECK:STDOUT: %tuple.type.d47: type = tuple_type (%tuple.type.186, %tuple.type.f94) [template]
  74. // CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [template]
  75. // CHECK:STDOUT: %Convert.specific_fn.70c: <specific function> = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template]
  76. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
  77. // CHECK:STDOUT: %tuple.236: %tuple.type.fe6 = tuple_value (%tuple.592, %int_1.5d2) [template]
  78. // CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
  79. // CHECK:STDOUT: %Convert.specific_fn.787: <specific function> = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [template]
  80. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
  81. // CHECK:STDOUT: %Convert.bound.b30: <bound method> = bound_method %int_3.1ba, %Convert.956 [template]
  82. // CHECK:STDOUT: %Convert.specific_fn.b42: <specific function> = specific_function %Convert.bound.b30, @Convert.2(%int_32) [template]
  83. // CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [template]
  84. // CHECK:STDOUT: %tuple.11a: %tuple.type.d07 = tuple_value (%int_2.ef8, %int_3.822) [template]
  85. // CHECK:STDOUT: %tuple.ba9: %tuple.type.fc1 = tuple_value (%tuple.236, %tuple.11a) [template]
  86. // CHECK:STDOUT: %X: %tuple.type.d07 = bind_symbolic_name X, 0 [symbolic]
  87. // CHECK:STDOUT: %X.patt: %tuple.type.d07 = symbolic_binding_pattern X, 0 [symbolic]
  88. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  89. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  90. // CHECK:STDOUT: %C.54f: type = class_type @C, @C(%X) [symbolic]
  91. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  92. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  93. // CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [template]
  94. // CHECK:STDOUT: %C.ee0: type = class_type @C, @C(%tuple.21c) [template]
  95. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  96. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  97. // CHECK:STDOUT: }
  98. // CHECK:STDOUT:
  99. // CHECK:STDOUT: imports {
  100. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  101. // CHECK:STDOUT: .Int = %Core.Int
  102. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  103. // CHECK:STDOUT: import Core//prelude
  104. // CHECK:STDOUT: import Core//prelude/...
  105. // CHECK:STDOUT: }
  106. // CHECK:STDOUT: }
  107. // CHECK:STDOUT:
  108. // CHECK:STDOUT: file {
  109. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  110. // CHECK:STDOUT: .Core = imports.%Core
  111. // CHECK:STDOUT: .a_ref = %a_ref
  112. // CHECK:STDOUT: .b_ref = %b_ref
  113. // CHECK:STDOUT: .C = %C.decl
  114. // CHECK:STDOUT: .F = %F.decl
  115. // CHECK:STDOUT: }
  116. // CHECK:STDOUT: %Core.import = import Core
  117. // CHECK:STDOUT: name_binding_decl {
  118. // CHECK:STDOUT: %a_ref.patt: %tuple.type.a1c = binding_pattern a_ref
  119. // CHECK:STDOUT: %.loc4_1: %tuple.type.a1c = var_pattern %a_ref.patt
  120. // CHECK:STDOUT: }
  121. // CHECK:STDOUT: %a_ref.var: ref %tuple.type.a1c = var a_ref
  122. // CHECK:STDOUT: %.loc4_17.1: type = splice_block %.loc4_17.3 [template = constants.%tuple.type.a1c] {
  123. // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  124. // CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  125. // CHECK:STDOUT: %.loc4_17.2: %tuple.type.85c = tuple_literal (%i32.loc4)
  126. // CHECK:STDOUT: %.loc4_17.3: type = converted %.loc4_17.2, constants.%tuple.type.a1c [template = constants.%tuple.type.a1c]
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT: %a_ref: ref %tuple.type.a1c = bind_name a_ref, %a_ref.var
  129. // CHECK:STDOUT: name_binding_decl {
  130. // CHECK:STDOUT: %b_ref.patt: %tuple.type.fc1 = binding_pattern b_ref
  131. // CHECK:STDOUT: %.loc5_1: %tuple.type.fc1 = var_pattern %b_ref.patt
  132. // CHECK:STDOUT: }
  133. // CHECK:STDOUT: %b_ref.var: ref %tuple.type.fc1 = var b_ref
  134. // CHECK:STDOUT: %.loc5_38.1: type = splice_block %.loc5_38.6 [template = constants.%tuple.type.fc1] {
  135. // CHECK:STDOUT: %int_32.loc5_15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  136. // CHECK:STDOUT: %i32.loc5_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  137. // CHECK:STDOUT: %.loc5_19: %tuple.type.85c = tuple_literal (%i32.loc5_15)
  138. // CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  139. // CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  140. // CHECK:STDOUT: %.loc5_25: %tuple.type.8c7 = tuple_literal (%.loc5_19, %i32.loc5_22)
  141. // CHECK:STDOUT: %int_32.loc5_29: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  142. // CHECK:STDOUT: %i32.loc5_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  143. // CHECK:STDOUT: %int_32.loc5_34: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  144. // CHECK:STDOUT: %i32.loc5_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  145. // CHECK:STDOUT: %.loc5_37: %tuple.type.24b = tuple_literal (%i32.loc5_29, %i32.loc5_34)
  146. // CHECK:STDOUT: %.loc5_38.2: %tuple.type.58c = tuple_literal (%.loc5_25, %.loc5_37)
  147. // CHECK:STDOUT: %.loc5_38.3: type = converted %.loc5_19, constants.%tuple.type.a1c [template = constants.%tuple.type.a1c]
  148. // CHECK:STDOUT: %.loc5_38.4: type = converted %.loc5_25, constants.%tuple.type.fe6 [template = constants.%tuple.type.fe6]
  149. // CHECK:STDOUT: %.loc5_38.5: type = converted %.loc5_37, constants.%tuple.type.d07 [template = constants.%tuple.type.d07]
  150. // CHECK:STDOUT: %.loc5_38.6: type = converted %.loc5_38.2, constants.%tuple.type.fc1 [template = constants.%tuple.type.fc1]
  151. // CHECK:STDOUT: }
  152. // CHECK:STDOUT: %b_ref: ref %tuple.type.fc1 = bind_name b_ref, %b_ref.var
  153. // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
  154. // CHECK:STDOUT: %X.patt.loc7_9.1: %tuple.type.d07 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)]
  155. // CHECK:STDOUT: %X.param_patt: %tuple.type.d07 = value_param_pattern %X.patt.loc7_9.1, runtime_param<none> [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)]
  156. // CHECK:STDOUT: } {
  157. // CHECK:STDOUT: %X.param: %tuple.type.d07 = value_param runtime_param<none>
  158. // CHECK:STDOUT: %.loc7_22.1: type = splice_block %.loc7_22.3 [template = constants.%tuple.type.d07] {
  159. // CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  160. // CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  161. // CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  162. // CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  163. // CHECK:STDOUT: %.loc7_22.2: %tuple.type.24b = tuple_literal (%i32.loc7_14, %i32.loc7_19)
  164. // CHECK:STDOUT: %.loc7_22.3: type = converted %.loc7_22.2, constants.%tuple.type.d07 [template = constants.%tuple.type.d07]
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT: %X.loc7_9.1: %tuple.type.d07 = bind_symbolic_name X, 0, %X.param [symbolic = %X.loc7_9.2 (constants.%X)]
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  169. // CHECK:STDOUT: %return.patt: %C.ee0 = return_slot_pattern
  170. // CHECK:STDOUT: %return.param_patt: %C.ee0 = out_param_pattern %return.patt, runtime_param0
  171. // CHECK:STDOUT: } {
  172. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C.generic]
  173. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  174. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  175. // CHECK:STDOUT: %.loc9_18.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
  176. // CHECK:STDOUT: %impl.elem0.loc9_18.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  177. // CHECK:STDOUT: %bound_method.loc9_18.1: <bound method> = bound_method %int_1, %impl.elem0.loc9_18.1 [template = constants.%Convert.bound.ab5]
  178. // CHECK:STDOUT: %specific_fn.loc9_18.1: <specific function> = specific_function %bound_method.loc9_18.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
  179. // CHECK:STDOUT: %int.convert_checked.loc9_18.1: init %i32 = call %specific_fn.loc9_18.1(%int_1) [template = constants.%int_1.5d2]
  180. // CHECK:STDOUT: %.loc9_18.2: %i32 = value_of_initializer %int.convert_checked.loc9_18.1 [template = constants.%int_1.5d2]
  181. // CHECK:STDOUT: %.loc9_18.3: %i32 = converted %int_1, %.loc9_18.2 [template = constants.%int_1.5d2]
  182. // CHECK:STDOUT: %impl.elem0.loc9_18.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  183. // CHECK:STDOUT: %bound_method.loc9_18.2: <bound method> = bound_method %int_2, %impl.elem0.loc9_18.2 [template = constants.%Convert.bound.ef9]
  184. // CHECK:STDOUT: %specific_fn.loc9_18.2: <specific function> = specific_function %bound_method.loc9_18.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
  185. // CHECK:STDOUT: %int.convert_checked.loc9_18.2: init %i32 = call %specific_fn.loc9_18.2(%int_2) [template = constants.%int_2.ef8]
  186. // CHECK:STDOUT: %.loc9_18.4: %i32 = value_of_initializer %int.convert_checked.loc9_18.2 [template = constants.%int_2.ef8]
  187. // CHECK:STDOUT: %.loc9_18.5: %i32 = converted %int_2, %.loc9_18.4 [template = constants.%int_2.ef8]
  188. // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc9_18.3, %.loc9_18.5) [template = constants.%tuple.21c]
  189. // CHECK:STDOUT: %.loc9_19: %tuple.type.d07 = converted %.loc9_18.1, %tuple [template = constants.%tuple.21c]
  190. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.21c) [template = constants.%C.ee0]
  191. // CHECK:STDOUT: %return.param: ref %C.ee0 = out_param runtime_param0
  192. // CHECK:STDOUT: %return: ref %C.ee0 = return_slot %return.param
  193. // CHECK:STDOUT: }
  194. // CHECK:STDOUT: }
  195. // CHECK:STDOUT:
  196. // CHECK:STDOUT: generic class @C(%X.loc7_9.1: %tuple.type.d07) {
  197. // CHECK:STDOUT: %X.loc7_9.2: %tuple.type.d07 = bind_symbolic_name X, 0 [symbolic = %X.loc7_9.2 (constants.%X)]
  198. // CHECK:STDOUT: %X.patt.loc7_9.2: %tuple.type.d07 = symbolic_binding_pattern X, 0 [symbolic = %X.patt.loc7_9.2 (constants.%X.patt)]
  199. // CHECK:STDOUT:
  200. // CHECK:STDOUT: !definition:
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: class {
  203. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  204. // CHECK:STDOUT: complete_type_witness = %complete_type
  205. // CHECK:STDOUT:
  206. // CHECK:STDOUT: !members:
  207. // CHECK:STDOUT: .Self = constants.%C.54f
  208. // CHECK:STDOUT: }
  209. // CHECK:STDOUT: }
  210. // CHECK:STDOUT:
  211. // CHECK:STDOUT: fn @F() -> %C.ee0;
  212. // CHECK:STDOUT:
  213. // CHECK:STDOUT: fn @__global_init() {
  214. // CHECK:STDOUT: !entry:
  215. // CHECK:STDOUT: %int_0.loc4: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  216. // CHECK:STDOUT: %.loc4_24.1: %tuple.type.985 = tuple_literal (%int_0.loc4)
  217. // CHECK:STDOUT: %impl.elem0.loc4: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  218. // CHECK:STDOUT: %bound_method.loc4: <bound method> = bound_method %int_0.loc4, %impl.elem0.loc4 [template = constants.%Convert.bound.d04]
  219. // CHECK:STDOUT: %specific_fn.loc4: <specific function> = specific_function %bound_method.loc4, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62]
  220. // CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.6a9]
  221. // CHECK:STDOUT: %.loc4_24.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [template = constants.%int_0.6a9]
  222. // CHECK:STDOUT: %.loc4_24.3: init %tuple.type.a1c = tuple_init (%.loc4_24.2) to file.%a_ref.var [template = constants.%tuple.592]
  223. // CHECK:STDOUT: %.loc4_1: init %tuple.type.a1c = converted %.loc4_24.1, %.loc4_24.3 [template = constants.%tuple.592]
  224. // CHECK:STDOUT: assign file.%a_ref.var, %.loc4_1
  225. // CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
  226. // CHECK:STDOUT: %.loc5_47.1: %tuple.type.985 = tuple_literal (%int_0.loc5)
  227. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  228. // CHECK:STDOUT: %.loc5_51.1: %tuple.type.186 = tuple_literal (%.loc5_47.1, %int_1)
  229. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  230. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
  231. // CHECK:STDOUT: %.loc5_59.1: %tuple.type.f94 = tuple_literal (%int_2, %int_3)
  232. // CHECK:STDOUT: %.loc5_60.1: %tuple.type.d47 = tuple_literal (%.loc5_51.1, %.loc5_59.1)
  233. // CHECK:STDOUT: %impl.elem0.loc5_47: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  234. // CHECK:STDOUT: %bound_method.loc5_47: <bound method> = bound_method %int_0.loc5, %impl.elem0.loc5_47 [template = constants.%Convert.bound.d04]
  235. // CHECK:STDOUT: %specific_fn.loc5_47: <specific function> = specific_function %bound_method.loc5_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.d62]
  236. // CHECK:STDOUT: %int.convert_checked.loc5_47: init %i32 = call %specific_fn.loc5_47(%int_0.loc5) [template = constants.%int_0.6a9]
  237. // CHECK:STDOUT: %.loc5_47.2: init %i32 = converted %int_0.loc5, %int.convert_checked.loc5_47 [template = constants.%int_0.6a9]
  238. // CHECK:STDOUT: %tuple.elem0.loc5_60: ref %tuple.type.fe6 = tuple_access file.%b_ref.var, element0
  239. // CHECK:STDOUT: %tuple.elem0.loc5_51: ref %tuple.type.a1c = tuple_access %tuple.elem0.loc5_60, element0
  240. // CHECK:STDOUT: %.loc5_47.3: init %tuple.type.a1c = tuple_init (%.loc5_47.2) to %tuple.elem0.loc5_51 [template = constants.%tuple.592]
  241. // CHECK:STDOUT: %.loc5_51.2: init %tuple.type.a1c = converted %.loc5_47.1, %.loc5_47.3 [template = constants.%tuple.592]
  242. // CHECK:STDOUT: %.loc5_51.3: init %tuple.type.a1c = initialize_from %.loc5_51.2 to %tuple.elem0.loc5_51 [template = constants.%tuple.592]
  243. // CHECK:STDOUT: %impl.elem0.loc5_51: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  244. // CHECK:STDOUT: %bound_method.loc5_51: <bound method> = bound_method %int_1, %impl.elem0.loc5_51 [template = constants.%Convert.bound.ab5]
  245. // CHECK:STDOUT: %specific_fn.loc5_51: <specific function> = specific_function %bound_method.loc5_51, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
  246. // CHECK:STDOUT: %int.convert_checked.loc5_51: init %i32 = call %specific_fn.loc5_51(%int_1) [template = constants.%int_1.5d2]
  247. // CHECK:STDOUT: %.loc5_51.4: init %i32 = converted %int_1, %int.convert_checked.loc5_51 [template = constants.%int_1.5d2]
  248. // CHECK:STDOUT: %tuple.elem1.loc5_51: ref %i32 = tuple_access %tuple.elem0.loc5_60, element1
  249. // CHECK:STDOUT: %.loc5_51.5: init %i32 = initialize_from %.loc5_51.4 to %tuple.elem1.loc5_51 [template = constants.%int_1.5d2]
  250. // CHECK:STDOUT: %.loc5_51.6: init %tuple.type.fe6 = tuple_init (%.loc5_51.3, %.loc5_51.5) to %tuple.elem0.loc5_60 [template = constants.%tuple.236]
  251. // CHECK:STDOUT: %.loc5_60.2: init %tuple.type.fe6 = converted %.loc5_51.1, %.loc5_51.6 [template = constants.%tuple.236]
  252. // CHECK:STDOUT: %impl.elem0.loc5_59.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  253. // CHECK:STDOUT: %bound_method.loc5_59.1: <bound method> = bound_method %int_2, %impl.elem0.loc5_59.1 [template = constants.%Convert.bound.ef9]
  254. // CHECK:STDOUT: %specific_fn.loc5_59.1: <specific function> = specific_function %bound_method.loc5_59.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
  255. // CHECK:STDOUT: %int.convert_checked.loc5_59.1: init %i32 = call %specific_fn.loc5_59.1(%int_2) [template = constants.%int_2.ef8]
  256. // CHECK:STDOUT: %.loc5_59.2: init %i32 = converted %int_2, %int.convert_checked.loc5_59.1 [template = constants.%int_2.ef8]
  257. // CHECK:STDOUT: %tuple.elem1.loc5_60: ref %tuple.type.d07 = tuple_access file.%b_ref.var, element1
  258. // CHECK:STDOUT: %tuple.elem0.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element0
  259. // CHECK:STDOUT: %.loc5_59.3: init %i32 = initialize_from %.loc5_59.2 to %tuple.elem0.loc5_59 [template = constants.%int_2.ef8]
  260. // CHECK:STDOUT: %impl.elem0.loc5_59.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  261. // CHECK:STDOUT: %bound_method.loc5_59.2: <bound method> = bound_method %int_3, %impl.elem0.loc5_59.2 [template = constants.%Convert.bound.b30]
  262. // CHECK:STDOUT: %specific_fn.loc5_59.2: <specific function> = specific_function %bound_method.loc5_59.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.b42]
  263. // CHECK:STDOUT: %int.convert_checked.loc5_59.2: init %i32 = call %specific_fn.loc5_59.2(%int_3) [template = constants.%int_3.822]
  264. // CHECK:STDOUT: %.loc5_59.4: init %i32 = converted %int_3, %int.convert_checked.loc5_59.2 [template = constants.%int_3.822]
  265. // CHECK:STDOUT: %tuple.elem1.loc5_59: ref %i32 = tuple_access %tuple.elem1.loc5_60, element1
  266. // CHECK:STDOUT: %.loc5_59.5: init %i32 = initialize_from %.loc5_59.4 to %tuple.elem1.loc5_59 [template = constants.%int_3.822]
  267. // CHECK:STDOUT: %.loc5_59.6: init %tuple.type.d07 = tuple_init (%.loc5_59.3, %.loc5_59.5) to %tuple.elem1.loc5_60 [template = constants.%tuple.11a]
  268. // CHECK:STDOUT: %.loc5_60.3: init %tuple.type.d07 = converted %.loc5_59.1, %.loc5_59.6 [template = constants.%tuple.11a]
  269. // CHECK:STDOUT: %.loc5_60.4: init %tuple.type.fc1 = tuple_init (%.loc5_60.2, %.loc5_60.3) to file.%b_ref.var [template = constants.%tuple.ba9]
  270. // CHECK:STDOUT: %.loc5_1: init %tuple.type.fc1 = converted %.loc5_60.1, %.loc5_60.4 [template = constants.%tuple.ba9]
  271. // CHECK:STDOUT: assign file.%b_ref.var, %.loc5_1
  272. // CHECK:STDOUT: return
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: specific @C(constants.%X) {
  276. // CHECK:STDOUT: %X.loc7_9.2 => constants.%X
  277. // CHECK:STDOUT: %X.patt.loc7_9.2 => constants.%X
  278. // CHECK:STDOUT: }
  279. // CHECK:STDOUT:
  280. // CHECK:STDOUT: specific @C(constants.%tuple.21c) {
  281. // CHECK:STDOUT: %X.loc7_9.2 => constants.%tuple.21c
  282. // CHECK:STDOUT: %X.patt.loc7_9.2 => constants.%tuple.21c
  283. // CHECK:STDOUT: }
  284. // CHECK:STDOUT:
  285. // CHECK:STDOUT: --- implicit.impl.carbon
  286. // CHECK:STDOUT:
  287. // CHECK:STDOUT: constants {
  288. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  289. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  290. // CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [template]
  291. // CHECK:STDOUT: %tuple.type.dd4: type = tuple_type (%i32) [template]
  292. // CHECK:STDOUT: %tuple.type.8c7: type = tuple_type (%tuple.type.85c, type) [template]
  293. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
  294. // CHECK:STDOUT: %tuple.type.58c: type = tuple_type (%tuple.type.8c7, %tuple.type.24b) [template]
  295. // CHECK:STDOUT: %tuple.type.154: type = tuple_type (%tuple.type.dd4, %i32) [template]
  296. // CHECK:STDOUT: %tuple.type.c2c: type = tuple_type (%i32, %i32) [template]
  297. // CHECK:STDOUT: %tuple.type.cfa: type = tuple_type (%tuple.type.154, %tuple.type.c2c) [template]
  298. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  299. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  300. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  301. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  302. // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic]
  303. // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic]
  304. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
  305. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  306. // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  307. // CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  308. // CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  309. // CHECK:STDOUT: %impl_witness.847: <witness> = impl_witness (imports.%Implicit.import_ref.773), @impl.1(%int_32) [template]
  310. // CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  311. // CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template]
  312. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template]
  313. // CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template]
  314. // CHECK:STDOUT: %Convert.bound.dc5: <bound method> = bound_method %int_1.5b8, %Convert.4cb [template]
  315. // CHECK:STDOUT: %Convert.specific_fn.51b: <specific function> = specific_function %Convert.bound.dc5, @Convert.2(%int_32) [template]
  316. // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [template]
  317. // CHECK:STDOUT: %Convert.bound.30f: <bound method> = bound_method %int_2.ecc, %Convert.4cb [template]
  318. // CHECK:STDOUT: %Convert.specific_fn.9b5: <specific function> = specific_function %Convert.bound.30f, @Convert.2(%int_32) [template]
  319. // CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [template]
  320. // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%int_1.47b, %int_2.d0d) [template]
  321. // CHECK:STDOUT: %C.cf0: type = class_type @C, @C(%tuple) [template]
  322. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  323. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  324. // CHECK:STDOUT: }
  325. // CHECK:STDOUT:
  326. // CHECK:STDOUT: imports {
  327. // CHECK:STDOUT: %Implicit.a_ref: ref %tuple.type.dd4 = import_ref Implicit//default, a_ref, loaded
  328. // CHECK:STDOUT: %Implicit.b_ref: ref %tuple.type.cfa = import_ref Implicit//default, b_ref, loaded
  329. // CHECK:STDOUT: %Implicit.C: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic]
  330. // CHECK:STDOUT: %Implicit.F: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F]
  331. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  332. // CHECK:STDOUT: .Int = %Core.Int
  333. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  334. // CHECK:STDOUT: import Core//prelude
  335. // CHECK:STDOUT: import Core//prelude/...
  336. // CHECK:STDOUT: }
  337. // CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
  338. // CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357]
  339. // CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded
  340. // CHECK:STDOUT: }
  341. // CHECK:STDOUT:
  342. // CHECK:STDOUT: file {
  343. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  344. // CHECK:STDOUT: .a_ref = imports.%Implicit.a_ref
  345. // CHECK:STDOUT: .b_ref = imports.%Implicit.b_ref
  346. // CHECK:STDOUT: .C = imports.%Implicit.C
  347. // CHECK:STDOUT: .F = imports.%Implicit.F
  348. // CHECK:STDOUT: .Core = imports.%Core
  349. // CHECK:STDOUT: .a = %a
  350. // CHECK:STDOUT: .b = %b
  351. // CHECK:STDOUT: .c = %c
  352. // CHECK:STDOUT: }
  353. // CHECK:STDOUT: %Implicit.import = import Implicit
  354. // CHECK:STDOUT: %default.import = import <none>
  355. // CHECK:STDOUT: %Core.import = import Core
  356. // CHECK:STDOUT: name_binding_decl {
  357. // CHECK:STDOUT: %a.patt: %tuple.type.dd4 = binding_pattern a
  358. // CHECK:STDOUT: %.loc4_1: %tuple.type.dd4 = var_pattern %a.patt
  359. // CHECK:STDOUT: }
  360. // CHECK:STDOUT: %a.var: ref %tuple.type.dd4 = var a
  361. // CHECK:STDOUT: %.loc4_13.1: type = splice_block %.loc4_13.3 [template = constants.%tuple.type.dd4] {
  362. // CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  363. // CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  364. // CHECK:STDOUT: %.loc4_13.2: %tuple.type.85c = tuple_literal (%i32.loc4)
  365. // CHECK:STDOUT: %.loc4_13.3: type = converted %.loc4_13.2, constants.%tuple.type.dd4 [template = constants.%tuple.type.dd4]
  366. // CHECK:STDOUT: }
  367. // CHECK:STDOUT: %a: ref %tuple.type.dd4 = bind_name a, %a.var
  368. // CHECK:STDOUT: name_binding_decl {
  369. // CHECK:STDOUT: %b.patt: %tuple.type.cfa = binding_pattern b
  370. // CHECK:STDOUT: %.loc5_1: %tuple.type.cfa = var_pattern %b.patt
  371. // CHECK:STDOUT: }
  372. // CHECK:STDOUT: %b.var: ref %tuple.type.cfa = var b
  373. // CHECK:STDOUT: %.loc5_34.1: type = splice_block %.loc5_34.6 [template = constants.%tuple.type.cfa] {
  374. // CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  375. // CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  376. // CHECK:STDOUT: %.loc5_15: %tuple.type.85c = tuple_literal (%i32.loc5_11)
  377. // CHECK:STDOUT: %int_32.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  378. // CHECK:STDOUT: %i32.loc5_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  379. // CHECK:STDOUT: %.loc5_21: %tuple.type.8c7 = tuple_literal (%.loc5_15, %i32.loc5_18)
  380. // CHECK:STDOUT: %int_32.loc5_25: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  381. // CHECK:STDOUT: %i32.loc5_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  382. // CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  383. // CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  384. // CHECK:STDOUT: %.loc5_33: %tuple.type.24b = tuple_literal (%i32.loc5_25, %i32.loc5_30)
  385. // CHECK:STDOUT: %.loc5_34.2: %tuple.type.58c = tuple_literal (%.loc5_21, %.loc5_33)
  386. // CHECK:STDOUT: %.loc5_34.3: type = converted %.loc5_15, constants.%tuple.type.dd4 [template = constants.%tuple.type.dd4]
  387. // CHECK:STDOUT: %.loc5_34.4: type = converted %.loc5_21, constants.%tuple.type.154 [template = constants.%tuple.type.154]
  388. // CHECK:STDOUT: %.loc5_34.5: type = converted %.loc5_33, constants.%tuple.type.c2c [template = constants.%tuple.type.c2c]
  389. // CHECK:STDOUT: %.loc5_34.6: type = converted %.loc5_34.2, constants.%tuple.type.cfa [template = constants.%tuple.type.cfa]
  390. // CHECK:STDOUT: }
  391. // CHECK:STDOUT: %b: ref %tuple.type.cfa = bind_name b, %b.var
  392. // CHECK:STDOUT: name_binding_decl {
  393. // CHECK:STDOUT: %c.patt: %C.cf0 = binding_pattern c
  394. // CHECK:STDOUT: %.loc6_1: %C.cf0 = var_pattern %c.patt
  395. // CHECK:STDOUT: }
  396. // CHECK:STDOUT: %c.var: ref %C.cf0 = var c
  397. // CHECK:STDOUT: %.loc6_16.1: type = splice_block %C [template = constants.%C.cf0] {
  398. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Implicit.C [template = constants.%C.generic]
  399. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  400. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  401. // CHECK:STDOUT: %.loc6_15.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
  402. // CHECK:STDOUT: %impl.elem0.loc6_15.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
  403. // CHECK:STDOUT: %bound_method.loc6_15.1: <bound method> = bound_method %int_1, %impl.elem0.loc6_15.1 [template = constants.%Convert.bound.dc5]
  404. // CHECK:STDOUT: %specific_fn.loc6_15.1: <specific function> = specific_function %bound_method.loc6_15.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.51b]
  405. // CHECK:STDOUT: %int.convert_checked.loc6_15.1: init %i32 = call %specific_fn.loc6_15.1(%int_1) [template = constants.%int_1.47b]
  406. // CHECK:STDOUT: %.loc6_15.2: %i32 = value_of_initializer %int.convert_checked.loc6_15.1 [template = constants.%int_1.47b]
  407. // CHECK:STDOUT: %.loc6_15.3: %i32 = converted %int_1, %.loc6_15.2 [template = constants.%int_1.47b]
  408. // CHECK:STDOUT: %impl.elem0.loc6_15.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
  409. // CHECK:STDOUT: %bound_method.loc6_15.2: <bound method> = bound_method %int_2, %impl.elem0.loc6_15.2 [template = constants.%Convert.bound.30f]
  410. // CHECK:STDOUT: %specific_fn.loc6_15.2: <specific function> = specific_function %bound_method.loc6_15.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5]
  411. // CHECK:STDOUT: %int.convert_checked.loc6_15.2: init %i32 = call %specific_fn.loc6_15.2(%int_2) [template = constants.%int_2.d0d]
  412. // CHECK:STDOUT: %.loc6_15.4: %i32 = value_of_initializer %int.convert_checked.loc6_15.2 [template = constants.%int_2.d0d]
  413. // CHECK:STDOUT: %.loc6_15.5: %i32 = converted %int_2, %.loc6_15.4 [template = constants.%int_2.d0d]
  414. // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc6_15.3, %.loc6_15.5) [template = constants.%tuple]
  415. // CHECK:STDOUT: %.loc6_16.2: %tuple.type.c2c = converted %.loc6_15.1, %tuple [template = constants.%tuple]
  416. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple) [template = constants.%C.cf0]
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT: %c: ref %C.cf0 = bind_name c, %c.var
  419. // CHECK:STDOUT: }
  420. // CHECK:STDOUT:
  421. // CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] {
  422. // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
  423. // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
  424. // CHECK:STDOUT:
  425. // CHECK:STDOUT: !definition:
  426. // CHECK:STDOUT:
  427. // CHECK:STDOUT: class {
  428. // CHECK:STDOUT: complete_type_witness = imports.%Implicit.import_ref.8f2
  429. // CHECK:STDOUT:
  430. // CHECK:STDOUT: !members:
  431. // CHECK:STDOUT: .Self = imports.%Implicit.import_ref.964
  432. // CHECK:STDOUT: }
  433. // CHECK:STDOUT: }
  434. // CHECK:STDOUT:
  435. // CHECK:STDOUT: fn @F() -> %C.cf0 [from "implicit.carbon"];
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: fn @__global_init() {
  438. // CHECK:STDOUT: !entry:
  439. // CHECK:STDOUT: %a_ref.ref: ref %tuple.type.dd4 = name_ref a_ref, imports.%Implicit.a_ref
  440. // CHECK:STDOUT: %tuple.elem0.loc4: ref %i32 = tuple_access %a_ref.ref, element0
  441. // CHECK:STDOUT: %.loc4_17.1: %i32 = bind_value %tuple.elem0.loc4
  442. // CHECK:STDOUT: %.loc4_17.2: init %tuple.type.dd4 = tuple_init (%.loc4_17.1) to file.%a.var
  443. // CHECK:STDOUT: %.loc4_1: init %tuple.type.dd4 = converted %a_ref.ref, %.loc4_17.2
  444. // CHECK:STDOUT: assign file.%a.var, %.loc4_1
  445. // CHECK:STDOUT: %b_ref.ref: ref %tuple.type.cfa = name_ref b_ref, imports.%Implicit.b_ref
  446. // CHECK:STDOUT: %tuple.elem0.loc5_38.1: ref %tuple.type.154 = tuple_access %b_ref.ref, element0
  447. // CHECK:STDOUT: %tuple.elem0.loc5_38.2: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc5_38.1, element0
  448. // CHECK:STDOUT: %tuple.elem0.loc5_38.3: ref %i32 = tuple_access %tuple.elem0.loc5_38.2, element0
  449. // CHECK:STDOUT: %.loc5_38.1: %i32 = bind_value %tuple.elem0.loc5_38.3
  450. // CHECK:STDOUT: %tuple.elem0.loc5_38.4: ref %tuple.type.154 = tuple_access file.%b.var, element0
  451. // CHECK:STDOUT: %tuple.elem0.loc5_38.5: ref %tuple.type.dd4 = tuple_access %tuple.elem0.loc5_38.4, element0
  452. // CHECK:STDOUT: %.loc5_38.2: init %tuple.type.dd4 = tuple_init (%.loc5_38.1) to %tuple.elem0.loc5_38.5
  453. // CHECK:STDOUT: %.loc5_38.3: init %tuple.type.dd4 = converted %tuple.elem0.loc5_38.2, %.loc5_38.2
  454. // CHECK:STDOUT: %.loc5_38.4: init %tuple.type.dd4 = initialize_from %.loc5_38.3 to %tuple.elem0.loc5_38.5
  455. // CHECK:STDOUT: %tuple.elem1.loc5_38.1: ref %i32 = tuple_access %tuple.elem0.loc5_38.1, element1
  456. // CHECK:STDOUT: %.loc5_38.5: %i32 = bind_value %tuple.elem1.loc5_38.1
  457. // CHECK:STDOUT: %tuple.elem1.loc5_38.2: ref %i32 = tuple_access %tuple.elem0.loc5_38.4, element1
  458. // CHECK:STDOUT: %.loc5_38.6: init %i32 = initialize_from %.loc5_38.5 to %tuple.elem1.loc5_38.2
  459. // CHECK:STDOUT: %.loc5_38.7: init %tuple.type.154 = tuple_init (%.loc5_38.4, %.loc5_38.6) to %tuple.elem0.loc5_38.4
  460. // CHECK:STDOUT: %.loc5_38.8: init %tuple.type.154 = converted %tuple.elem0.loc5_38.1, %.loc5_38.7
  461. // CHECK:STDOUT: %tuple.elem1.loc5_38.3: ref %tuple.type.c2c = tuple_access %b_ref.ref, element1
  462. // CHECK:STDOUT: %tuple.elem0.loc5_38.6: ref %i32 = tuple_access %tuple.elem1.loc5_38.3, element0
  463. // CHECK:STDOUT: %.loc5_38.9: %i32 = bind_value %tuple.elem0.loc5_38.6
  464. // CHECK:STDOUT: %tuple.elem1.loc5_38.4: ref %tuple.type.c2c = tuple_access file.%b.var, element1
  465. // CHECK:STDOUT: %tuple.elem0.loc5_38.7: ref %i32 = tuple_access %tuple.elem1.loc5_38.4, element0
  466. // CHECK:STDOUT: %.loc5_38.10: init %i32 = initialize_from %.loc5_38.9 to %tuple.elem0.loc5_38.7
  467. // CHECK:STDOUT: %tuple.elem1.loc5_38.5: ref %i32 = tuple_access %tuple.elem1.loc5_38.3, element1
  468. // CHECK:STDOUT: %.loc5_38.11: %i32 = bind_value %tuple.elem1.loc5_38.5
  469. // CHECK:STDOUT: %tuple.elem1.loc5_38.6: ref %i32 = tuple_access %tuple.elem1.loc5_38.4, element1
  470. // CHECK:STDOUT: %.loc5_38.12: init %i32 = initialize_from %.loc5_38.11 to %tuple.elem1.loc5_38.6
  471. // CHECK:STDOUT: %.loc5_38.13: init %tuple.type.c2c = tuple_init (%.loc5_38.10, %.loc5_38.12) to %tuple.elem1.loc5_38.4
  472. // CHECK:STDOUT: %.loc5_38.14: init %tuple.type.c2c = converted %tuple.elem1.loc5_38.3, %.loc5_38.13
  473. // CHECK:STDOUT: %.loc5_38.15: init %tuple.type.cfa = tuple_init (%.loc5_38.8, %.loc5_38.14) to file.%b.var
  474. // CHECK:STDOUT: %.loc5_1: init %tuple.type.cfa = converted %b_ref.ref, %.loc5_38.15
  475. // CHECK:STDOUT: assign file.%b.var, %.loc5_1
  476. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Implicit.F [template = constants.%F]
  477. // CHECK:STDOUT: %.loc6: ref %C.cf0 = splice_block file.%c.var {}
  478. // CHECK:STDOUT: %F.call: init %C.cf0 = call %F.ref() to %.loc6
  479. // CHECK:STDOUT: assign file.%c.var, %F.call
  480. // CHECK:STDOUT: return
  481. // CHECK:STDOUT: }
  482. // CHECK:STDOUT:
  483. // CHECK:STDOUT: specific @C(constants.%X) {
  484. // CHECK:STDOUT: %X => constants.%X
  485. // CHECK:STDOUT: %X.patt => constants.%X
  486. // CHECK:STDOUT: }
  487. // CHECK:STDOUT:
  488. // CHECK:STDOUT: specific @C(constants.%tuple) {
  489. // CHECK:STDOUT: %X => constants.%tuple
  490. // CHECK:STDOUT: %X.patt => constants.%tuple
  491. // CHECK:STDOUT:
  492. // CHECK:STDOUT: !definition:
  493. // CHECK:STDOUT: }
  494. // CHECK:STDOUT:
  495. // CHECK:STDOUT: --- fail_bad_type.impl.carbon
  496. // CHECK:STDOUT:
  497. // CHECK:STDOUT: constants {
  498. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  499. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  500. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  501. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  502. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  503. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  504. // CHECK:STDOUT: %tuple.type.c2c: type = tuple_type (%i32, %i32) [template]
  505. // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic]
  506. // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic]
  507. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
  508. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  509. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template]
  510. // CHECK:STDOUT: %tuple.type.37f: type = tuple_type (Core.IntLiteral, Core.IntLiteral, Core.IntLiteral) [template]
  511. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  512. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  513. // CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [template]
  514. // CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [template]
  515. // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%int_1.47b, %int_2.d0d) [template]
  516. // CHECK:STDOUT: %C.cf0: type = class_type @C, @C(%tuple) [template]
  517. // CHECK:STDOUT: }
  518. // CHECK:STDOUT:
  519. // CHECK:STDOUT: imports {
  520. // CHECK:STDOUT: %Implicit.a_ref = import_ref Implicit//default, a_ref, unloaded
  521. // CHECK:STDOUT: %Implicit.b_ref = import_ref Implicit//default, b_ref, unloaded
  522. // CHECK:STDOUT: %Implicit.C: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic]
  523. // CHECK:STDOUT: %Implicit.F: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F]
  524. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  525. // CHECK:STDOUT: import Core//prelude
  526. // CHECK:STDOUT: import Core//prelude/...
  527. // CHECK:STDOUT: }
  528. // CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
  529. // CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357]
  530. // CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded
  531. // CHECK:STDOUT: }
  532. // CHECK:STDOUT:
  533. // CHECK:STDOUT: file {
  534. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  535. // CHECK:STDOUT: .a_ref = imports.%Implicit.a_ref
  536. // CHECK:STDOUT: .b_ref = imports.%Implicit.b_ref
  537. // CHECK:STDOUT: .C = imports.%Implicit.C
  538. // CHECK:STDOUT: .F = imports.%Implicit.F
  539. // CHECK:STDOUT: .Core = imports.%Core
  540. // CHECK:STDOUT: .c_bad = %c_bad
  541. // CHECK:STDOUT: }
  542. // CHECK:STDOUT: %Implicit.import = import Implicit
  543. // CHECK:STDOUT: %default.import = import <none>
  544. // CHECK:STDOUT: %Core.import = import Core
  545. // CHECK:STDOUT: name_binding_decl {
  546. // CHECK:STDOUT: %c_bad.patt: <error> = binding_pattern c_bad
  547. // CHECK:STDOUT: %.loc12_1: <error> = var_pattern %c_bad.patt
  548. // CHECK:STDOUT: }
  549. // CHECK:STDOUT: %c_bad.var: ref <error> = var c_bad
  550. // CHECK:STDOUT: %.1: <error> = splice_block <error> [template = <error>] {
  551. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Implicit.C [template = constants.%C.generic]
  552. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  553. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  554. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3]
  555. // CHECK:STDOUT: %.loc12_22: %tuple.type.37f = tuple_literal (%int_1, %int_2, %int_3)
  556. // CHECK:STDOUT: }
  557. // CHECK:STDOUT: %c_bad: <error> = bind_name c_bad, <error>
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] {
  561. // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
  562. // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
  563. // CHECK:STDOUT:
  564. // CHECK:STDOUT: !definition:
  565. // CHECK:STDOUT:
  566. // CHECK:STDOUT: class {
  567. // CHECK:STDOUT: complete_type_witness = imports.%Implicit.import_ref.8f2
  568. // CHECK:STDOUT:
  569. // CHECK:STDOUT: !members:
  570. // CHECK:STDOUT: .Self = imports.%Implicit.import_ref.964
  571. // CHECK:STDOUT: }
  572. // CHECK:STDOUT: }
  573. // CHECK:STDOUT:
  574. // CHECK:STDOUT: fn @F() -> %C.cf0 [from "implicit.carbon"];
  575. // CHECK:STDOUT:
  576. // CHECK:STDOUT: fn @__global_init() {
  577. // CHECK:STDOUT: !entry:
  578. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Implicit.F [template = constants.%F]
  579. // CHECK:STDOUT: %.loc12: ref %C.cf0 = temporary_storage
  580. // CHECK:STDOUT: %F.call: init %C.cf0 = call %F.ref() to %.loc12
  581. // CHECK:STDOUT: assign file.%c_bad.var, <error>
  582. // CHECK:STDOUT: return
  583. // CHECK:STDOUT: }
  584. // CHECK:STDOUT:
  585. // CHECK:STDOUT: specific @C(constants.%X) {
  586. // CHECK:STDOUT: %X => constants.%X
  587. // CHECK:STDOUT: %X.patt => constants.%X
  588. // CHECK:STDOUT: }
  589. // CHECK:STDOUT:
  590. // CHECK:STDOUT: specific @C(constants.%tuple) {
  591. // CHECK:STDOUT: %X => constants.%tuple
  592. // CHECK:STDOUT: %X.patt => constants.%tuple
  593. // CHECK:STDOUT:
  594. // CHECK:STDOUT: !definition:
  595. // CHECK:STDOUT: }
  596. // CHECK:STDOUT:
  597. // CHECK:STDOUT: --- fail_bad_value.impl.carbon
  598. // CHECK:STDOUT:
  599. // CHECK:STDOUT: constants {
  600. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  601. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  602. // CHECK:STDOUT: %C.type: type = generic_class_type @C [template]
  603. // CHECK:STDOUT: %C.generic: %C.type = struct_value () [template]
  604. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  605. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  606. // CHECK:STDOUT: %tuple.type.c2c: type = tuple_type (%i32, %i32) [template]
  607. // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic]
  608. // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic]
  609. // CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
  610. // CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template]
  611. // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  612. // CHECK:STDOUT: %ImplicitAs.type.b9e: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  613. // CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  614. // CHECK:STDOUT: %impl_witness.847: <witness> = impl_witness (imports.%Implicit.import_ref.773), @impl.1(%int_32) [template]
  615. // CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  616. // CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template]
  617. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.b9e = facet_value Core.IntLiteral, %impl_witness.847 [template]
  618. // CHECK:STDOUT: %.088: type = fn_type_with_self_type %Convert.type.ea0, %ImplicitAs.facet [template]
  619. // CHECK:STDOUT: %Convert.bound.a00: <bound method> = bound_method %int_3.1ba, %Convert.4cb [template]
  620. // CHECK:STDOUT: %Convert.specific_fn.dec: <specific function> = specific_function %Convert.bound.a00, @Convert.2(%int_32) [template]
  621. // CHECK:STDOUT: %int_3.d47: %i32 = int_value 3 [template]
  622. // CHECK:STDOUT: %Convert.bound.694: <bound method> = bound_method %int_4.0c1, %Convert.4cb [template]
  623. // CHECK:STDOUT: %Convert.specific_fn.739: <specific function> = specific_function %Convert.bound.694, @Convert.2(%int_32) [template]
  624. // CHECK:STDOUT: %int_4.ea3: %i32 = int_value 4 [template]
  625. // CHECK:STDOUT: %tuple.5de: %tuple.type.c2c = tuple_value (%int_3.d47, %int_4.ea3) [template]
  626. // CHECK:STDOUT: %C.ed5: type = class_type @C, @C(%tuple.5de) [template]
  627. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  628. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  629. // CHECK:STDOUT: %int_2: %i32 = int_value 2 [template]
  630. // CHECK:STDOUT: %int_1: %i32 = int_value 1 [template]
  631. // CHECK:STDOUT: %tuple.56c: %tuple.type.c2c = tuple_value (%int_1, %int_2) [template]
  632. // CHECK:STDOUT: %C.cf0: type = class_type @C, @C(%tuple.56c) [template]
  633. // CHECK:STDOUT: }
  634. // CHECK:STDOUT:
  635. // CHECK:STDOUT: imports {
  636. // CHECK:STDOUT: %Implicit.a_ref = import_ref Implicit//default, a_ref, unloaded
  637. // CHECK:STDOUT: %Implicit.b_ref = import_ref Implicit//default, b_ref, unloaded
  638. // CHECK:STDOUT: %Implicit.C: %C.type = import_ref Implicit//default, C, loaded [template = constants.%C.generic]
  639. // CHECK:STDOUT: %Implicit.F: %F.type = import_ref Implicit//default, F, loaded [template = constants.%F]
  640. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  641. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  642. // CHECK:STDOUT: import Core//prelude
  643. // CHECK:STDOUT: import Core//prelude/...
  644. // CHECK:STDOUT: }
  645. // CHECK:STDOUT: %Implicit.import_ref.554: %tuple.type.c2c = import_ref Implicit//default, loc7_9, loaded [symbolic = @C.%X (constants.%X)]
  646. // CHECK:STDOUT: %Implicit.import_ref.8f2: <witness> = import_ref Implicit//default, loc7_26, loaded [template = constants.%complete_type.357]
  647. // CHECK:STDOUT: %Implicit.import_ref.964 = import_ref Implicit//default, inst1161 [no loc], unloaded
  648. // CHECK:STDOUT: }
  649. // CHECK:STDOUT:
  650. // CHECK:STDOUT: file {
  651. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  652. // CHECK:STDOUT: .a_ref = imports.%Implicit.a_ref
  653. // CHECK:STDOUT: .b_ref = imports.%Implicit.b_ref
  654. // CHECK:STDOUT: .C = imports.%Implicit.C
  655. // CHECK:STDOUT: .F = imports.%Implicit.F
  656. // CHECK:STDOUT: .Core = imports.%Core
  657. // CHECK:STDOUT: .c_bad = %c_bad
  658. // CHECK:STDOUT: }
  659. // CHECK:STDOUT: %Implicit.import = import Implicit
  660. // CHECK:STDOUT: %default.import = import <none>
  661. // CHECK:STDOUT: %Core.import = import Core
  662. // CHECK:STDOUT: name_binding_decl {
  663. // CHECK:STDOUT: %c_bad.patt: %C.ed5 = binding_pattern c_bad
  664. // CHECK:STDOUT: %.loc11_1: %C.ed5 = var_pattern %c_bad.patt
  665. // CHECK:STDOUT: }
  666. // CHECK:STDOUT: %c_bad.var: ref %C.ed5 = var c_bad
  667. // CHECK:STDOUT: %.loc11_20.1: type = splice_block %C [template = constants.%C.ed5] {
  668. // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Implicit.C [template = constants.%C.generic]
  669. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
  670. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1]
  671. // CHECK:STDOUT: %.loc11_19.1: %tuple.type.f94 = tuple_literal (%int_3, %int_4)
  672. // CHECK:STDOUT: %impl.elem0.loc11_19.1: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
  673. // CHECK:STDOUT: %bound_method.loc11_19.1: <bound method> = bound_method %int_3, %impl.elem0.loc11_19.1 [template = constants.%Convert.bound.a00]
  674. // CHECK:STDOUT: %specific_fn.loc11_19.1: <specific function> = specific_function %bound_method.loc11_19.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.dec]
  675. // CHECK:STDOUT: %int.convert_checked.loc11_19.1: init %i32 = call %specific_fn.loc11_19.1(%int_3) [template = constants.%int_3.d47]
  676. // CHECK:STDOUT: %.loc11_19.2: %i32 = value_of_initializer %int.convert_checked.loc11_19.1 [template = constants.%int_3.d47]
  677. // CHECK:STDOUT: %.loc11_19.3: %i32 = converted %int_3, %.loc11_19.2 [template = constants.%int_3.d47]
  678. // CHECK:STDOUT: %impl.elem0.loc11_19.2: %.088 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
  679. // CHECK:STDOUT: %bound_method.loc11_19.2: <bound method> = bound_method %int_4, %impl.elem0.loc11_19.2 [template = constants.%Convert.bound.694]
  680. // CHECK:STDOUT: %specific_fn.loc11_19.2: <specific function> = specific_function %bound_method.loc11_19.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.739]
  681. // CHECK:STDOUT: %int.convert_checked.loc11_19.2: init %i32 = call %specific_fn.loc11_19.2(%int_4) [template = constants.%int_4.ea3]
  682. // CHECK:STDOUT: %.loc11_19.4: %i32 = value_of_initializer %int.convert_checked.loc11_19.2 [template = constants.%int_4.ea3]
  683. // CHECK:STDOUT: %.loc11_19.5: %i32 = converted %int_4, %.loc11_19.4 [template = constants.%int_4.ea3]
  684. // CHECK:STDOUT: %tuple: %tuple.type.c2c = tuple_value (%.loc11_19.3, %.loc11_19.5) [template = constants.%tuple.5de]
  685. // CHECK:STDOUT: %.loc11_20.2: %tuple.type.c2c = converted %.loc11_19.1, %tuple [template = constants.%tuple.5de]
  686. // CHECK:STDOUT: %C: type = class_type @C, @C(constants.%tuple.5de) [template = constants.%C.ed5]
  687. // CHECK:STDOUT: }
  688. // CHECK:STDOUT: %c_bad: ref %C.ed5 = bind_name c_bad, %c_bad.var
  689. // CHECK:STDOUT: }
  690. // CHECK:STDOUT:
  691. // CHECK:STDOUT: generic class @C(imports.%Implicit.import_ref.554: %tuple.type.c2c) [from "implicit.carbon"] {
  692. // CHECK:STDOUT: %X: %tuple.type.c2c = bind_symbolic_name X, 0 [symbolic = %X (constants.%X)]
  693. // CHECK:STDOUT: %X.patt: %tuple.type.c2c = symbolic_binding_pattern X, 0 [symbolic = %X.patt (constants.%X.patt)]
  694. // CHECK:STDOUT:
  695. // CHECK:STDOUT: !definition:
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: class {
  698. // CHECK:STDOUT: complete_type_witness = imports.%Implicit.import_ref.8f2
  699. // CHECK:STDOUT:
  700. // CHECK:STDOUT: !members:
  701. // CHECK:STDOUT: .Self = imports.%Implicit.import_ref.964
  702. // CHECK:STDOUT: }
  703. // CHECK:STDOUT: }
  704. // CHECK:STDOUT:
  705. // CHECK:STDOUT: fn @F() -> %C.cf0 [from "implicit.carbon"];
  706. // CHECK:STDOUT:
  707. // CHECK:STDOUT: fn @__global_init() {
  708. // CHECK:STDOUT: !entry:
  709. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%Implicit.F [template = constants.%F]
  710. // CHECK:STDOUT: %.loc11_26: ref %C.cf0 = temporary_storage
  711. // CHECK:STDOUT: %F.call: init %C.cf0 = call %F.ref() to %.loc11_26
  712. // CHECK:STDOUT: %.loc11_1: %C.ed5 = converted %F.call, <error> [template = <error>]
  713. // CHECK:STDOUT: assign file.%c_bad.var, <error>
  714. // CHECK:STDOUT: return
  715. // CHECK:STDOUT: }
  716. // CHECK:STDOUT:
  717. // CHECK:STDOUT: specific @C(constants.%X) {
  718. // CHECK:STDOUT: %X => constants.%X
  719. // CHECK:STDOUT: %X.patt => constants.%X
  720. // CHECK:STDOUT: }
  721. // CHECK:STDOUT:
  722. // CHECK:STDOUT: specific @C(constants.%tuple.5de) {
  723. // CHECK:STDOUT: %X => constants.%tuple.5de
  724. // CHECK:STDOUT: %X.patt => constants.%tuple.5de
  725. // CHECK:STDOUT:
  726. // CHECK:STDOUT: !definition:
  727. // CHECK:STDOUT: }
  728. // CHECK:STDOUT:
  729. // CHECK:STDOUT: specific @C(constants.%tuple.56c) {
  730. // CHECK:STDOUT: %X => constants.%tuple.56c
  731. // CHECK:STDOUT: %X.patt => constants.%tuple.56c
  732. // CHECK:STDOUT:
  733. // CHECK:STDOUT: !definition:
  734. // CHECK:STDOUT: }
  735. // CHECK:STDOUT: