tuple.carbon 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  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/deduce/tuple.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/deduce/tuple.carbon
  10. // --- tuple_type.carbon
  11. library "[[@TEST_NAME]]";
  12. class C {}
  13. class D {}
  14. fn F[T:! type, U:! type](pair: (T, U)) -> U { return F(pair); }
  15. fn G(pair: (C, D)) -> D {
  16. return F(pair);
  17. }
  18. // --- tuple_value.carbon
  19. library "[[@TEST_NAME]]";
  20. class HasPair(Pair:! (i32, i32)) {}
  21. fn F[A:! i32, B:! i32](h: HasPair((A, B))) -> i32 { return B; }
  22. fn G(h: HasPair((1, 2))) -> i32 {
  23. return F(h);
  24. }
  25. // --- fail_inconsistent.carbon
  26. library "[[@TEST_NAME]]";
  27. class C {}
  28. class D {}
  29. fn F[T:! type](pair: (T, T)) -> T;
  30. fn G(pair: (C, D)) -> D {
  31. // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE+7]]:10: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent]
  32. // CHECK:STDERR: return F(pair);
  33. // CHECK:STDERR: ^~~~~~~
  34. // CHECK:STDERR: fail_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  35. // CHECK:STDERR: fn F[T:! type](pair: (T, T)) -> T;
  36. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  37. // CHECK:STDERR:
  38. return F(pair);
  39. }
  40. // CHECK:STDOUT: --- tuple_type.carbon
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: constants {
  43. // CHECK:STDOUT: %C: type = class_type @C [template]
  44. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  45. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  46. // CHECK:STDOUT: %D: type = class_type @D [template]
  47. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  48. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  49. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
  50. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic]
  51. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
  52. // CHECK:STDOUT: %tuple.type.30b: type = tuple_type (%T, %U) [symbolic]
  53. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  54. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  55. // CHECK:STDOUT: %require_complete.b54: <witness> = require_complete_type %U [symbolic]
  56. // CHECK:STDOUT: %require_complete.fe1: <witness> = require_complete_type %tuple.type.30b [symbolic]
  57. // CHECK:STDOUT: %F.specific_fn.dd9: <specific function> = specific_function %F, @F(%T, %U) [symbolic]
  58. // CHECK:STDOUT: %tuple.type.e8a: type = tuple_type (%C, %D) [template]
  59. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  60. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  61. // CHECK:STDOUT: %F.specific_fn.4a7: <specific function> = specific_function %F, @F(%C, %D) [template]
  62. // CHECK:STDOUT: %complete_type.53b: <witness> = complete_type_witness %tuple.type.e8a [template]
  63. // CHECK:STDOUT: }
  64. // CHECK:STDOUT:
  65. // CHECK:STDOUT: imports {
  66. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  67. // CHECK:STDOUT: import Core//prelude
  68. // CHECK:STDOUT: import Core//prelude/...
  69. // CHECK:STDOUT: }
  70. // CHECK:STDOUT: }
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: file {
  73. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  74. // CHECK:STDOUT: .Core = imports.%Core
  75. // CHECK:STDOUT: .C = %C.decl
  76. // CHECK:STDOUT: .D = %D.decl
  77. // CHECK:STDOUT: .F = %F.decl
  78. // CHECK:STDOUT: .G = %G.decl
  79. // CHECK:STDOUT: }
  80. // CHECK:STDOUT: %Core.import = import Core
  81. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  82. // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {}
  83. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  84. // CHECK:STDOUT: %T.patt.loc7_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)]
  85. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc7_6.1, runtime_param<none> [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)]
  86. // CHECK:STDOUT: %U.patt.loc7_16.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc7_16.2 (constants.%U.patt)]
  87. // CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc7_16.1, runtime_param<none> [symbolic = %U.patt.loc7_16.2 (constants.%U.patt)]
  88. // CHECK:STDOUT: %pair.patt: @F.%tuple.type (%tuple.type.30b) = binding_pattern pair
  89. // CHECK:STDOUT: %pair.param_patt: @F.%tuple.type (%tuple.type.30b) = value_param_pattern %pair.patt, runtime_param0
  90. // CHECK:STDOUT: %return.patt: @F.%U.loc7_16.2 (%U) = return_slot_pattern
  91. // CHECK:STDOUT: %return.param_patt: @F.%U.loc7_16.2 (%U) = out_param_pattern %return.patt, runtime_param1
  92. // CHECK:STDOUT: } {
  93. // CHECK:STDOUT: %U.ref.loc7_43: type = name_ref U, %U.loc7_16.1 [symbolic = %U.loc7_16.2 (constants.%U)]
  94. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  95. // CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)]
  96. // CHECK:STDOUT: %U.param: type = value_param runtime_param<none>
  97. // CHECK:STDOUT: %U.loc7_16.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc7_16.2 (constants.%U)]
  98. // CHECK:STDOUT: %pair.param: @F.%tuple.type (%tuple.type.30b) = value_param runtime_param0
  99. // CHECK:STDOUT: %.loc7_37.1: type = splice_block %.loc7_37.3 [symbolic = %tuple.type (constants.%tuple.type.30b)] {
  100. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)]
  101. // CHECK:STDOUT: %U.ref.loc7_36: type = name_ref U, %U.loc7_16.1 [symbolic = %U.loc7_16.2 (constants.%U)]
  102. // CHECK:STDOUT: %.loc7_37.2: %tuple.type.24b = tuple_literal (%T.ref, %U.ref.loc7_36)
  103. // CHECK:STDOUT: %.loc7_37.3: type = converted %.loc7_37.2, constants.%tuple.type.30b [symbolic = %tuple.type (constants.%tuple.type.30b)]
  104. // CHECK:STDOUT: }
  105. // CHECK:STDOUT: %pair: @F.%tuple.type (%tuple.type.30b) = bind_name pair, %pair.param
  106. // CHECK:STDOUT: %return.param: ref @F.%U.loc7_16.2 (%U) = out_param runtime_param1
  107. // CHECK:STDOUT: %return: ref @F.%U.loc7_16.2 (%U) = return_slot %return.param
  108. // CHECK:STDOUT: }
  109. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  110. // CHECK:STDOUT: %pair.patt: %tuple.type.e8a = binding_pattern pair
  111. // CHECK:STDOUT: %pair.param_patt: %tuple.type.e8a = value_param_pattern %pair.patt, runtime_param0
  112. // CHECK:STDOUT: %return.patt: %D = return_slot_pattern
  113. // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1
  114. // CHECK:STDOUT: } {
  115. // CHECK:STDOUT: %D.ref.loc9_23: type = name_ref D, file.%D.decl [template = constants.%D]
  116. // CHECK:STDOUT: %pair.param: %tuple.type.e8a = value_param runtime_param0
  117. // CHECK:STDOUT: %.loc9_17.1: type = splice_block %.loc9_17.3 [template = constants.%tuple.type.e8a] {
  118. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  119. // CHECK:STDOUT: %D.ref.loc9_16: type = name_ref D, file.%D.decl [template = constants.%D]
  120. // CHECK:STDOUT: %.loc9_17.2: %tuple.type.24b = tuple_literal (%C.ref, %D.ref.loc9_16)
  121. // CHECK:STDOUT: %.loc9_17.3: type = converted %.loc9_17.2, constants.%tuple.type.e8a [template = constants.%tuple.type.e8a]
  122. // CHECK:STDOUT: }
  123. // CHECK:STDOUT: %pair: %tuple.type.e8a = bind_name pair, %pair.param
  124. // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1
  125. // CHECK:STDOUT: %return: ref %D = return_slot %return.param
  126. // CHECK:STDOUT: }
  127. // CHECK:STDOUT: }
  128. // CHECK:STDOUT:
  129. // CHECK:STDOUT: class @C {
  130. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  131. // CHECK:STDOUT: complete_type_witness = %complete_type
  132. // CHECK:STDOUT:
  133. // CHECK:STDOUT: !members:
  134. // CHECK:STDOUT: .Self = constants.%C
  135. // CHECK:STDOUT: }
  136. // CHECK:STDOUT:
  137. // CHECK:STDOUT: class @D {
  138. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  139. // CHECK:STDOUT: complete_type_witness = %complete_type
  140. // CHECK:STDOUT:
  141. // CHECK:STDOUT: !members:
  142. // CHECK:STDOUT: .Self = constants.%D
  143. // CHECK:STDOUT: }
  144. // CHECK:STDOUT:
  145. // CHECK:STDOUT: generic fn @F(%T.loc7_6.1: type, %U.loc7_16.1: type) {
  146. // CHECK:STDOUT: %T.loc7_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_6.2 (constants.%T)]
  147. // CHECK:STDOUT: %T.patt.loc7_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)]
  148. // CHECK:STDOUT: %U.loc7_16.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc7_16.2 (constants.%U)]
  149. // CHECK:STDOUT: %U.patt.loc7_16.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc7_16.2 (constants.%U.patt)]
  150. // CHECK:STDOUT: %tuple.type: type = tuple_type (@F.%T.loc7_6.2 (%T), @F.%U.loc7_16.2 (%U)) [symbolic = %tuple.type (constants.%tuple.type.30b)]
  151. // CHECK:STDOUT:
  152. // CHECK:STDOUT: !definition:
  153. // CHECK:STDOUT: %require_complete.loc7_40: <witness> = require_complete_type @F.%U.loc7_16.2 (%U) [symbolic = %require_complete.loc7_40 (constants.%require_complete.b54)]
  154. // CHECK:STDOUT: %require_complete.loc7_30: <witness> = require_complete_type @F.%tuple.type (%tuple.type.30b) [symbolic = %require_complete.loc7_30 (constants.%require_complete.fe1)]
  155. // CHECK:STDOUT: %F.specific_fn.loc7_54.2: <specific function> = specific_function constants.%F, @F(%T.loc7_6.2, %U.loc7_16.2) [symbolic = %F.specific_fn.loc7_54.2 (constants.%F.specific_fn.dd9)]
  156. // CHECK:STDOUT:
  157. // CHECK:STDOUT: fn[%T.param_patt: type, %U.param_patt: type](%pair.param_patt: @F.%tuple.type (%tuple.type.30b)) -> @F.%U.loc7_16.2 (%U) {
  158. // CHECK:STDOUT: !entry:
  159. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
  160. // CHECK:STDOUT: %pair.ref: @F.%tuple.type (%tuple.type.30b) = name_ref pair, %pair
  161. // CHECK:STDOUT: %F.specific_fn.loc7_54.1: <specific function> = specific_function %F.ref, @F(constants.%T, constants.%U) [symbolic = %F.specific_fn.loc7_54.2 (constants.%F.specific_fn.dd9)]
  162. // CHECK:STDOUT: %F.call: init @F.%U.loc7_16.2 (%U) = call %F.specific_fn.loc7_54.1(%pair.ref)
  163. // CHECK:STDOUT: %.loc7_61.1: @F.%U.loc7_16.2 (%U) = value_of_initializer %F.call
  164. // CHECK:STDOUT: %.loc7_61.2: @F.%U.loc7_16.2 (%U) = converted %F.call, %.loc7_61.1
  165. // CHECK:STDOUT: return %.loc7_61.2
  166. // CHECK:STDOUT: }
  167. // CHECK:STDOUT: }
  168. // CHECK:STDOUT:
  169. // CHECK:STDOUT: fn @G(%pair.param_patt: %tuple.type.e8a) -> %return.param_patt: %D {
  170. // CHECK:STDOUT: !entry:
  171. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
  172. // CHECK:STDOUT: %pair.ref: %tuple.type.e8a = name_ref pair, %pair
  173. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%C, constants.%D) [template = constants.%F.specific_fn.4a7]
  174. // CHECK:STDOUT: %.loc9_20: ref %D = splice_block %return {}
  175. // CHECK:STDOUT: %F.call: init %D = call %F.specific_fn(%pair.ref) to %.loc9_20
  176. // CHECK:STDOUT: return %F.call to %return
  177. // CHECK:STDOUT: }
  178. // CHECK:STDOUT:
  179. // CHECK:STDOUT: specific @F(constants.%T, constants.%U) {
  180. // CHECK:STDOUT: %T.loc7_6.2 => constants.%T
  181. // CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T
  182. // CHECK:STDOUT: %U.loc7_16.2 => constants.%U
  183. // CHECK:STDOUT: %U.patt.loc7_16.2 => constants.%U
  184. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.30b
  185. // CHECK:STDOUT:
  186. // CHECK:STDOUT: !definition:
  187. // CHECK:STDOUT: %require_complete.loc7_40 => constants.%require_complete.b54
  188. // CHECK:STDOUT: %require_complete.loc7_30 => constants.%require_complete.fe1
  189. // CHECK:STDOUT: %F.specific_fn.loc7_54.2 => constants.%F.specific_fn.dd9
  190. // CHECK:STDOUT: }
  191. // CHECK:STDOUT:
  192. // CHECK:STDOUT: specific @F(%T.loc7_6.2, %U.loc7_16.2) {}
  193. // CHECK:STDOUT:
  194. // CHECK:STDOUT: specific @F(constants.%C, constants.%D) {
  195. // CHECK:STDOUT: %T.loc7_6.2 => constants.%C
  196. // CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%C
  197. // CHECK:STDOUT: %U.loc7_16.2 => constants.%D
  198. // CHECK:STDOUT: %U.patt.loc7_16.2 => constants.%D
  199. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.e8a
  200. // CHECK:STDOUT:
  201. // CHECK:STDOUT: !definition:
  202. // CHECK:STDOUT: %require_complete.loc7_40 => constants.%complete_type.357
  203. // CHECK:STDOUT: %require_complete.loc7_30 => constants.%complete_type.53b
  204. // CHECK:STDOUT: %F.specific_fn.loc7_54.2 => constants.%F.specific_fn.4a7
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT:
  207. // CHECK:STDOUT: --- tuple_value.carbon
  208. // CHECK:STDOUT:
  209. // CHECK:STDOUT: constants {
  210. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  211. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  212. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
  213. // CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [template]
  214. // CHECK:STDOUT: %Pair: %tuple.type.d07 = bind_symbolic_name Pair, 0 [symbolic]
  215. // CHECK:STDOUT: %Pair.patt: %tuple.type.d07 = symbolic_binding_pattern Pair, 0 [symbolic]
  216. // CHECK:STDOUT: %HasPair.type: type = generic_class_type @HasPair [template]
  217. // CHECK:STDOUT: %HasPair.generic: %HasPair.type = struct_value () [template]
  218. // CHECK:STDOUT: %HasPair.920: type = class_type @HasPair, @HasPair(%Pair) [symbolic]
  219. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  220. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  221. // CHECK:STDOUT: %A: %i32 = bind_symbolic_name A, 0 [symbolic]
  222. // CHECK:STDOUT: %A.patt: %i32 = symbolic_binding_pattern A, 0 [symbolic]
  223. // CHECK:STDOUT: %B: %i32 = bind_symbolic_name B, 1 [symbolic]
  224. // CHECK:STDOUT: %B.patt: %i32 = symbolic_binding_pattern B, 1 [symbolic]
  225. // CHECK:STDOUT: %tuple.159: %tuple.type.d07 = tuple_value (%A, %B) [symbolic]
  226. // CHECK:STDOUT: %HasPair.568: type = class_type @HasPair, @HasPair(%tuple.159) [symbolic]
  227. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  228. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  229. // CHECK:STDOUT: %require_complete.6bc: <witness> = require_complete_type %HasPair.568 [symbolic]
  230. // CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
  231. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  232. // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  233. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  234. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  235. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
  236. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  237. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
  238. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
  239. // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
  240. // CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [template]
  241. // CHECK:STDOUT: %Convert.specific_fn.70c: <specific function> = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template]
  242. // CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
  243. // CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
  244. // CHECK:STDOUT: %Convert.specific_fn.787: <specific function> = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [template]
  245. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
  246. // CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [template]
  247. // CHECK:STDOUT: %HasPair.369: type = class_type @HasPair, @HasPair(%tuple.21c) [template]
  248. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  249. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  250. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%int_1.5d2, %int_2.ef8) [template]
  251. // CHECK:STDOUT: }
  252. // CHECK:STDOUT:
  253. // CHECK:STDOUT: imports {
  254. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  255. // CHECK:STDOUT: .Int = %Core.Int
  256. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  257. // CHECK:STDOUT: import Core//prelude
  258. // CHECK:STDOUT: import Core//prelude/...
  259. // CHECK:STDOUT: }
  260. // CHECK:STDOUT: }
  261. // CHECK:STDOUT:
  262. // CHECK:STDOUT: file {
  263. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  264. // CHECK:STDOUT: .Core = imports.%Core
  265. // CHECK:STDOUT: .HasPair = %HasPair.decl
  266. // CHECK:STDOUT: .F = %F.decl
  267. // CHECK:STDOUT: .G = %G.decl
  268. // CHECK:STDOUT: }
  269. // CHECK:STDOUT: %Core.import = import Core
  270. // CHECK:STDOUT: %HasPair.decl: %HasPair.type = class_decl @HasPair [template = constants.%HasPair.generic] {
  271. // CHECK:STDOUT: %Pair.patt.loc4_15.1: %tuple.type.d07 = symbolic_binding_pattern Pair, 0 [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)]
  272. // CHECK:STDOUT: %Pair.param_patt: %tuple.type.d07 = value_param_pattern %Pair.patt.loc4_15.1, runtime_param<none> [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)]
  273. // CHECK:STDOUT: } {
  274. // CHECK:STDOUT: %Pair.param: %tuple.type.d07 = value_param runtime_param<none>
  275. // CHECK:STDOUT: %.loc4_31.1: type = splice_block %.loc4_31.3 [template = constants.%tuple.type.d07] {
  276. // CHECK:STDOUT: %int_32.loc4_23: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  277. // CHECK:STDOUT: %i32.loc4_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  278. // CHECK:STDOUT: %int_32.loc4_28: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  279. // CHECK:STDOUT: %i32.loc4_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  280. // CHECK:STDOUT: %.loc4_31.2: %tuple.type.24b = tuple_literal (%i32.loc4_23, %i32.loc4_28)
  281. // CHECK:STDOUT: %.loc4_31.3: type = converted %.loc4_31.2, constants.%tuple.type.d07 [template = constants.%tuple.type.d07]
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT: %Pair.loc4_15.1: %tuple.type.d07 = bind_symbolic_name Pair, 0, %Pair.param [symbolic = %Pair.loc4_15.2 (constants.%Pair)]
  284. // CHECK:STDOUT: }
  285. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  286. // CHECK:STDOUT: %A.patt.loc6_6.1: %i32 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)]
  287. // CHECK:STDOUT: %A.param_patt: %i32 = value_param_pattern %A.patt.loc6_6.1, runtime_param<none> [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)]
  288. // CHECK:STDOUT: %B.patt.loc6_15.1: %i32 = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)]
  289. // CHECK:STDOUT: %B.param_patt: %i32 = value_param_pattern %B.patt.loc6_15.1, runtime_param<none> [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)]
  290. // CHECK:STDOUT: %h.patt: @F.%HasPair.loc6_41.2 (%HasPair.568) = binding_pattern h
  291. // CHECK:STDOUT: %h.param_patt: @F.%HasPair.loc6_41.2 (%HasPair.568) = value_param_pattern %h.patt, runtime_param0
  292. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  293. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  294. // CHECK:STDOUT: } {
  295. // CHECK:STDOUT: %int_32.loc6_47: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  296. // CHECK:STDOUT: %i32.loc6_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  297. // CHECK:STDOUT: %A.param: %i32 = value_param runtime_param<none>
  298. // CHECK:STDOUT: %.loc6_10: type = splice_block %i32.loc6_10 [template = constants.%i32] {
  299. // CHECK:STDOUT: %int_32.loc6_10: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  300. // CHECK:STDOUT: %i32.loc6_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  301. // CHECK:STDOUT: }
  302. // CHECK:STDOUT: %A.loc6_6.1: %i32 = bind_symbolic_name A, 0, %A.param [symbolic = %A.loc6_6.2 (constants.%A)]
  303. // CHECK:STDOUT: %B.param: %i32 = value_param runtime_param<none>
  304. // CHECK:STDOUT: %.loc6_19: type = splice_block %i32.loc6_19 [template = constants.%i32] {
  305. // CHECK:STDOUT: %int_32.loc6_19: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  306. // CHECK:STDOUT: %i32.loc6_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  307. // CHECK:STDOUT: }
  308. // CHECK:STDOUT: %B.loc6_15.1: %i32 = bind_symbolic_name B, 1, %B.param [symbolic = %B.loc6_15.2 (constants.%B)]
  309. // CHECK:STDOUT: %h.param: @F.%HasPair.loc6_41.2 (%HasPair.568) = value_param runtime_param0
  310. // CHECK:STDOUT: %.loc6_41.1: type = splice_block %HasPair.loc6_41.1 [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.568)] {
  311. // CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.generic]
  312. // CHECK:STDOUT: %A.ref: %i32 = name_ref A, %A.loc6_6.1 [symbolic = %A.loc6_6.2 (constants.%A)]
  313. // CHECK:STDOUT: %B.ref.loc6_39: %i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)]
  314. // CHECK:STDOUT: %.loc6_40: %tuple.type.d07 = tuple_literal (%A.ref, %B.ref.loc6_39)
  315. // CHECK:STDOUT: %tuple.loc6_40.1: %tuple.type.d07 = tuple_value (%A.ref, %B.ref.loc6_39) [symbolic = %tuple.loc6_40.2 (constants.%tuple.159)]
  316. // CHECK:STDOUT: %.loc6_41.2: %tuple.type.d07 = converted %.loc6_40, %tuple.loc6_40.1 [symbolic = %tuple.loc6_40.2 (constants.%tuple.159)]
  317. // CHECK:STDOUT: %HasPair.loc6_41.1: type = class_type @HasPair, @HasPair(constants.%tuple.159) [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.568)]
  318. // CHECK:STDOUT: }
  319. // CHECK:STDOUT: %h: @F.%HasPair.loc6_41.2 (%HasPair.568) = bind_name h, %h.param
  320. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  321. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  322. // CHECK:STDOUT: }
  323. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  324. // CHECK:STDOUT: %h.patt: %HasPair.369 = binding_pattern h
  325. // CHECK:STDOUT: %h.param_patt: %HasPair.369 = value_param_pattern %h.patt, runtime_param0
  326. // CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
  327. // CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
  328. // CHECK:STDOUT: } {
  329. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  330. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  331. // CHECK:STDOUT: %h.param: %HasPair.369 = value_param runtime_param0
  332. // CHECK:STDOUT: %.loc8_23.1: type = splice_block %HasPair [template = constants.%HasPair.369] {
  333. // CHECK:STDOUT: %HasPair.ref: %HasPair.type = name_ref HasPair, file.%HasPair.decl [template = constants.%HasPair.generic]
  334. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
  335. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  336. // CHECK:STDOUT: %.loc8_22.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
  337. // CHECK:STDOUT: %impl.elem0.loc8_22.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  338. // CHECK:STDOUT: %bound_method.loc8_22.1: <bound method> = bound_method %int_1, %impl.elem0.loc8_22.1 [template = constants.%Convert.bound.ab5]
  339. // CHECK:STDOUT: %specific_fn.loc8_22.1: <specific function> = specific_function %bound_method.loc8_22.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
  340. // CHECK:STDOUT: %int.convert_checked.loc8_22.1: init %i32 = call %specific_fn.loc8_22.1(%int_1) [template = constants.%int_1.5d2]
  341. // CHECK:STDOUT: %.loc8_22.2: %i32 = value_of_initializer %int.convert_checked.loc8_22.1 [template = constants.%int_1.5d2]
  342. // CHECK:STDOUT: %.loc8_22.3: %i32 = converted %int_1, %.loc8_22.2 [template = constants.%int_1.5d2]
  343. // CHECK:STDOUT: %impl.elem0.loc8_22.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  344. // CHECK:STDOUT: %bound_method.loc8_22.2: <bound method> = bound_method %int_2, %impl.elem0.loc8_22.2 [template = constants.%Convert.bound.ef9]
  345. // CHECK:STDOUT: %specific_fn.loc8_22.2: <specific function> = specific_function %bound_method.loc8_22.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
  346. // CHECK:STDOUT: %int.convert_checked.loc8_22.2: init %i32 = call %specific_fn.loc8_22.2(%int_2) [template = constants.%int_2.ef8]
  347. // CHECK:STDOUT: %.loc8_22.4: %i32 = value_of_initializer %int.convert_checked.loc8_22.2 [template = constants.%int_2.ef8]
  348. // CHECK:STDOUT: %.loc8_22.5: %i32 = converted %int_2, %.loc8_22.4 [template = constants.%int_2.ef8]
  349. // CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc8_22.3, %.loc8_22.5) [template = constants.%tuple.21c]
  350. // CHECK:STDOUT: %.loc8_23.2: %tuple.type.d07 = converted %.loc8_22.1, %tuple [template = constants.%tuple.21c]
  351. // CHECK:STDOUT: %HasPair: type = class_type @HasPair, @HasPair(constants.%tuple.21c) [template = constants.%HasPair.369]
  352. // CHECK:STDOUT: }
  353. // CHECK:STDOUT: %h: %HasPair.369 = bind_name h, %h.param
  354. // CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
  355. // CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
  356. // CHECK:STDOUT: }
  357. // CHECK:STDOUT: }
  358. // CHECK:STDOUT:
  359. // CHECK:STDOUT: generic class @HasPair(%Pair.loc4_15.1: %tuple.type.d07) {
  360. // CHECK:STDOUT: %Pair.loc4_15.2: %tuple.type.d07 = bind_symbolic_name Pair, 0 [symbolic = %Pair.loc4_15.2 (constants.%Pair)]
  361. // CHECK:STDOUT: %Pair.patt.loc4_15.2: %tuple.type.d07 = symbolic_binding_pattern Pair, 0 [symbolic = %Pair.patt.loc4_15.2 (constants.%Pair.patt)]
  362. // CHECK:STDOUT:
  363. // CHECK:STDOUT: !definition:
  364. // CHECK:STDOUT:
  365. // CHECK:STDOUT: class {
  366. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  367. // CHECK:STDOUT: complete_type_witness = %complete_type
  368. // CHECK:STDOUT:
  369. // CHECK:STDOUT: !members:
  370. // CHECK:STDOUT: .Self = constants.%HasPair.920
  371. // CHECK:STDOUT: }
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT:
  374. // CHECK:STDOUT: generic fn @F(%A.loc6_6.1: %i32, %B.loc6_15.1: %i32) {
  375. // CHECK:STDOUT: %A.loc6_6.2: %i32 = bind_symbolic_name A, 0 [symbolic = %A.loc6_6.2 (constants.%A)]
  376. // CHECK:STDOUT: %A.patt.loc6_6.2: %i32 = symbolic_binding_pattern A, 0 [symbolic = %A.patt.loc6_6.2 (constants.%A.patt)]
  377. // CHECK:STDOUT: %B.loc6_15.2: %i32 = bind_symbolic_name B, 1 [symbolic = %B.loc6_15.2 (constants.%B)]
  378. // CHECK:STDOUT: %B.patt.loc6_15.2: %i32 = symbolic_binding_pattern B, 1 [symbolic = %B.patt.loc6_15.2 (constants.%B.patt)]
  379. // CHECK:STDOUT: %tuple.loc6_40.2: %tuple.type.d07 = tuple_value (%A.loc6_6.2, %B.loc6_15.2) [symbolic = %tuple.loc6_40.2 (constants.%tuple.159)]
  380. // CHECK:STDOUT: %HasPair.loc6_41.2: type = class_type @HasPair, @HasPair(%tuple.loc6_40.2) [symbolic = %HasPair.loc6_41.2 (constants.%HasPair.568)]
  381. // CHECK:STDOUT:
  382. // CHECK:STDOUT: !definition:
  383. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @F.%HasPair.loc6_41.2 (%HasPair.568) [symbolic = %require_complete (constants.%require_complete.6bc)]
  384. // CHECK:STDOUT:
  385. // CHECK:STDOUT: fn[%A.param_patt: %i32, %B.param_patt: %i32](%h.param_patt: @F.%HasPair.loc6_41.2 (%HasPair.568)) -> %i32 {
  386. // CHECK:STDOUT: !entry:
  387. // CHECK:STDOUT: %B.ref.loc6_60: %i32 = name_ref B, %B.loc6_15.1 [symbolic = %B.loc6_15.2 (constants.%B)]
  388. // CHECK:STDOUT: return %B.ref.loc6_60
  389. // CHECK:STDOUT: }
  390. // CHECK:STDOUT: }
  391. // CHECK:STDOUT:
  392. // CHECK:STDOUT: fn @G(%h.param_patt: %HasPair.369) -> %i32 {
  393. // CHECK:STDOUT: !entry:
  394. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
  395. // CHECK:STDOUT: %h.ref: %HasPair.369 = name_ref h, %h
  396. // CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F.ref, @F(constants.%int_1.5d2, constants.%int_2.ef8) [template = constants.%F.specific_fn]
  397. // CHECK:STDOUT: %F.call: init %i32 = call %F.specific_fn(%h.ref)
  398. // CHECK:STDOUT: %.loc9_14.1: %i32 = value_of_initializer %F.call
  399. // CHECK:STDOUT: %.loc9_14.2: %i32 = converted %F.call, %.loc9_14.1
  400. // CHECK:STDOUT: return %.loc9_14.2
  401. // CHECK:STDOUT: }
  402. // CHECK:STDOUT:
  403. // CHECK:STDOUT: specific @HasPair(constants.%Pair) {
  404. // CHECK:STDOUT: %Pair.loc4_15.2 => constants.%Pair
  405. // CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%Pair
  406. // CHECK:STDOUT: }
  407. // CHECK:STDOUT:
  408. // CHECK:STDOUT: specific @HasPair(constants.%tuple.159) {
  409. // CHECK:STDOUT: %Pair.loc4_15.2 => constants.%tuple.159
  410. // CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%tuple.159
  411. // CHECK:STDOUT:
  412. // CHECK:STDOUT: !definition:
  413. // CHECK:STDOUT: }
  414. // CHECK:STDOUT:
  415. // CHECK:STDOUT: specific @F(constants.%A, constants.%B) {
  416. // CHECK:STDOUT: %A.loc6_6.2 => constants.%A
  417. // CHECK:STDOUT: %A.patt.loc6_6.2 => constants.%A
  418. // CHECK:STDOUT: %B.loc6_15.2 => constants.%B
  419. // CHECK:STDOUT: %B.patt.loc6_15.2 => constants.%B
  420. // CHECK:STDOUT: %tuple.loc6_40.2 => constants.%tuple.159
  421. // CHECK:STDOUT: %HasPair.loc6_41.2 => constants.%HasPair.568
  422. // CHECK:STDOUT: }
  423. // CHECK:STDOUT:
  424. // CHECK:STDOUT: specific @HasPair(@F.%tuple.loc6_40.2) {}
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: specific @HasPair(constants.%tuple.21c) {
  427. // CHECK:STDOUT: %Pair.loc4_15.2 => constants.%tuple.21c
  428. // CHECK:STDOUT: %Pair.patt.loc4_15.2 => constants.%tuple.21c
  429. // CHECK:STDOUT:
  430. // CHECK:STDOUT: !definition:
  431. // CHECK:STDOUT: }
  432. // CHECK:STDOUT:
  433. // CHECK:STDOUT: specific @F(constants.%int_1.5d2, constants.%int_2.ef8) {
  434. // CHECK:STDOUT: %A.loc6_6.2 => constants.%int_1.5d2
  435. // CHECK:STDOUT: %A.patt.loc6_6.2 => constants.%int_1.5d2
  436. // CHECK:STDOUT: %B.loc6_15.2 => constants.%int_2.ef8
  437. // CHECK:STDOUT: %B.patt.loc6_15.2 => constants.%int_2.ef8
  438. // CHECK:STDOUT: %tuple.loc6_40.2 => constants.%tuple.21c
  439. // CHECK:STDOUT: %HasPair.loc6_41.2 => constants.%HasPair.369
  440. // CHECK:STDOUT:
  441. // CHECK:STDOUT: !definition:
  442. // CHECK:STDOUT: %require_complete => constants.%complete_type.357
  443. // CHECK:STDOUT: }
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: --- fail_inconsistent.carbon
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: constants {
  448. // CHECK:STDOUT: %C: type = class_type @C [template]
  449. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  450. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
  451. // CHECK:STDOUT: %D: type = class_type @D [template]
  452. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  453. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  454. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
  455. // CHECK:STDOUT: %tuple.type.d00: type = tuple_type (%T, %T) [symbolic]
  456. // CHECK:STDOUT: %F.type: type = fn_type @F [template]
  457. // CHECK:STDOUT: %F: %F.type = struct_value () [template]
  458. // CHECK:STDOUT: %tuple.type.e8a: type = tuple_type (%C, %D) [template]
  459. // CHECK:STDOUT: %G.type: type = fn_type @G [template]
  460. // CHECK:STDOUT: %G: %G.type = struct_value () [template]
  461. // CHECK:STDOUT: }
  462. // CHECK:STDOUT:
  463. // CHECK:STDOUT: imports {
  464. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  465. // CHECK:STDOUT: import Core//prelude
  466. // CHECK:STDOUT: import Core//prelude/...
  467. // CHECK:STDOUT: }
  468. // CHECK:STDOUT: }
  469. // CHECK:STDOUT:
  470. // CHECK:STDOUT: file {
  471. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  472. // CHECK:STDOUT: .Core = imports.%Core
  473. // CHECK:STDOUT: .C = %C.decl
  474. // CHECK:STDOUT: .D = %D.decl
  475. // CHECK:STDOUT: .F = %F.decl
  476. // CHECK:STDOUT: .G = %G.decl
  477. // CHECK:STDOUT: }
  478. // CHECK:STDOUT: %Core.import = import Core
  479. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
  480. // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} {}
  481. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
  482. // CHECK:STDOUT: %T.patt.loc7_6.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)]
  483. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc7_6.1, runtime_param<none> [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)]
  484. // CHECK:STDOUT: %pair.patt: @F.%tuple.type (%tuple.type.d00) = binding_pattern pair
  485. // CHECK:STDOUT: %pair.param_patt: @F.%tuple.type (%tuple.type.d00) = value_param_pattern %pair.patt, runtime_param0
  486. // CHECK:STDOUT: %return.patt: @F.%T.loc7_6.2 (%T) = return_slot_pattern
  487. // CHECK:STDOUT: %return.param_patt: @F.%T.loc7_6.2 (%T) = out_param_pattern %return.patt, runtime_param1
  488. // CHECK:STDOUT: } {
  489. // CHECK:STDOUT: %T.ref.loc7_33: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)]
  490. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  491. // CHECK:STDOUT: %T.loc7_6.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc7_6.2 (constants.%T)]
  492. // CHECK:STDOUT: %pair.param: @F.%tuple.type (%tuple.type.d00) = value_param runtime_param0
  493. // CHECK:STDOUT: %.loc7_27.1: type = splice_block %.loc7_27.3 [symbolic = %tuple.type (constants.%tuple.type.d00)] {
  494. // CHECK:STDOUT: %T.ref.loc7_23: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)]
  495. // CHECK:STDOUT: %T.ref.loc7_26: type = name_ref T, %T.loc7_6.1 [symbolic = %T.loc7_6.2 (constants.%T)]
  496. // CHECK:STDOUT: %.loc7_27.2: %tuple.type.24b = tuple_literal (%T.ref.loc7_23, %T.ref.loc7_26)
  497. // CHECK:STDOUT: %.loc7_27.3: type = converted %.loc7_27.2, constants.%tuple.type.d00 [symbolic = %tuple.type (constants.%tuple.type.d00)]
  498. // CHECK:STDOUT: }
  499. // CHECK:STDOUT: %pair: @F.%tuple.type (%tuple.type.d00) = bind_name pair, %pair.param
  500. // CHECK:STDOUT: %return.param: ref @F.%T.loc7_6.2 (%T) = out_param runtime_param1
  501. // CHECK:STDOUT: %return: ref @F.%T.loc7_6.2 (%T) = return_slot %return.param
  502. // CHECK:STDOUT: }
  503. // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
  504. // CHECK:STDOUT: %pair.patt: %tuple.type.e8a = binding_pattern pair
  505. // CHECK:STDOUT: %pair.param_patt: %tuple.type.e8a = value_param_pattern %pair.patt, runtime_param0
  506. // CHECK:STDOUT: %return.patt: %D = return_slot_pattern
  507. // CHECK:STDOUT: %return.param_patt: %D = out_param_pattern %return.patt, runtime_param1
  508. // CHECK:STDOUT: } {
  509. // CHECK:STDOUT: %D.ref.loc9_23: type = name_ref D, file.%D.decl [template = constants.%D]
  510. // CHECK:STDOUT: %pair.param: %tuple.type.e8a = value_param runtime_param0
  511. // CHECK:STDOUT: %.loc9_17.1: type = splice_block %.loc9_17.3 [template = constants.%tuple.type.e8a] {
  512. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
  513. // CHECK:STDOUT: %D.ref.loc9_16: type = name_ref D, file.%D.decl [template = constants.%D]
  514. // CHECK:STDOUT: %.loc9_17.2: %tuple.type.24b = tuple_literal (%C.ref, %D.ref.loc9_16)
  515. // CHECK:STDOUT: %.loc9_17.3: type = converted %.loc9_17.2, constants.%tuple.type.e8a [template = constants.%tuple.type.e8a]
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT: %pair: %tuple.type.e8a = bind_name pair, %pair.param
  518. // CHECK:STDOUT: %return.param: ref %D = out_param runtime_param1
  519. // CHECK:STDOUT: %return: ref %D = return_slot %return.param
  520. // CHECK:STDOUT: }
  521. // CHECK:STDOUT: }
  522. // CHECK:STDOUT:
  523. // CHECK:STDOUT: class @C {
  524. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  525. // CHECK:STDOUT: complete_type_witness = %complete_type
  526. // CHECK:STDOUT:
  527. // CHECK:STDOUT: !members:
  528. // CHECK:STDOUT: .Self = constants.%C
  529. // CHECK:STDOUT: }
  530. // CHECK:STDOUT:
  531. // CHECK:STDOUT: class @D {
  532. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
  533. // CHECK:STDOUT: complete_type_witness = %complete_type
  534. // CHECK:STDOUT:
  535. // CHECK:STDOUT: !members:
  536. // CHECK:STDOUT: .Self = constants.%D
  537. // CHECK:STDOUT: }
  538. // CHECK:STDOUT:
  539. // CHECK:STDOUT: generic fn @F(%T.loc7_6.1: type) {
  540. // CHECK:STDOUT: %T.loc7_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc7_6.2 (constants.%T)]
  541. // CHECK:STDOUT: %T.patt.loc7_6.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_6.2 (constants.%T.patt)]
  542. // CHECK:STDOUT: %tuple.type: type = tuple_type (@F.%T.loc7_6.2 (%T), @F.%T.loc7_6.2 (%T)) [symbolic = %tuple.type (constants.%tuple.type.d00)]
  543. // CHECK:STDOUT:
  544. // CHECK:STDOUT: fn[%T.param_patt: type](%pair.param_patt: @F.%tuple.type (%tuple.type.d00)) -> @F.%T.loc7_6.2 (%T);
  545. // CHECK:STDOUT: }
  546. // CHECK:STDOUT:
  547. // CHECK:STDOUT: fn @G(%pair.param_patt: %tuple.type.e8a) -> %return.param_patt: %D {
  548. // CHECK:STDOUT: !entry:
  549. // CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [template = constants.%F]
  550. // CHECK:STDOUT: %pair.ref: %tuple.type.e8a = name_ref pair, %pair
  551. // CHECK:STDOUT: return <error> to %return
  552. // CHECK:STDOUT: }
  553. // CHECK:STDOUT:
  554. // CHECK:STDOUT: specific @F(constants.%T) {
  555. // CHECK:STDOUT: %T.loc7_6.2 => constants.%T
  556. // CHECK:STDOUT: %T.patt.loc7_6.2 => constants.%T
  557. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.d00
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT: