deduce.carbon 132 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.carbon
  6. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  7. // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
  8. //
  9. // AUTOUPDATE
  10. // TIP: To test this file alone, run:
  11. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/deduce.carbon
  12. // TIP: To dump output, run:
  13. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/deduce.carbon
  14. // --- deduce_explicit.carbon
  15. library "[[@TEST_NAME]]";
  16. fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  17. fn CallExplicitGenericParam() -> i32* {
  18. return ExplicitGenericParam(i32);
  19. }
  20. fn CallExplicitGenericParamWithGenericArg(T:! type) -> {.a: T}* {
  21. return ExplicitGenericParam({.a: T});
  22. }
  23. // --- fail_deduce_explicit_non_constant.carbon
  24. library "[[@TEST_NAME]]";
  25. fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  26. fn CallExplicitGenericParamConst(T:! type) {
  27. ExplicitGenericParam(T);
  28. }
  29. fn CallExplicitGenericParamNonConst(T: type) {
  30. // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE+7]]:3: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant]
  31. // CHECK:STDERR: ExplicitGenericParam(T);
  32. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
  33. // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE-10]]:25: note: initializing generic parameter `T` declared here [InitializingGenericParam]
  34. // CHECK:STDERR: fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  35. // CHECK:STDERR: ^~~~~~~~
  36. // CHECK:STDERR:
  37. ExplicitGenericParam(T);
  38. }
  39. // --- explicit_vs_deduced.carbon
  40. library "[[@TEST_NAME]]";
  41. class A {}
  42. fn ExplicitAndAlsoDeduced(T:! type, x: T) -> T* {
  43. return ExplicitAndAlsoDeduced(T, x);
  44. }
  45. fn CallExplicitAndAlsoDeduced() -> A* {
  46. return ExplicitAndAlsoDeduced(A, {});
  47. }
  48. // --- deduce_implicit.carbon
  49. library "[[@TEST_NAME]]";
  50. fn ImplicitGenericParam[T:! type](x: T) -> T* { return ImplicitGenericParam(x); }
  51. fn CallImplicitGenericParam(n: i32) -> i32* {
  52. return ImplicitGenericParam(n);
  53. }
  54. // --- deduce_nested_tuple.carbon
  55. library "[[@TEST_NAME]]";
  56. fn TupleParam[T:! type](unused x: (T, i32)) {}
  57. fn CallTupleParam() {
  58. TupleParam((1, 2));
  59. }
  60. // --- deduce_nested_struct.carbon
  61. library "[[@TEST_NAME]]";
  62. fn StructParam[T:! type](unused x: {.a: T, .b: i32}) {}
  63. fn CallStructParam() {
  64. StructParam({.a = 1, .b = 2});
  65. }
  66. // --- fail_deduce_bigger_struct.carbon
  67. library "[[@TEST_NAME]]";
  68. fn BigStructParam[T:! type](unused x: {.c: T, .d: i32, .e: i32}) {}
  69. fn CallBigStructParam() {
  70. // CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  71. // CHECK:STDERR: BigStructParam({.c = 3, .d = 4});
  72. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  73. // CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  74. // CHECK:STDERR: fn BigStructParam[T:! type](unused x: {.c: T, .d: i32, .e: i32}) {}
  75. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  76. // CHECK:STDERR:
  77. BigStructParam({.c = 3, .d = 4});
  78. }
  79. // --- fail_deduce_smaller_struct.carbon
  80. library "[[@TEST_NAME]]";
  81. fn SmallStructParam[T:! type](unused x: {.f: T, .g: i32}) {}
  82. fn CallSmallStructParam() {
  83. // CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  84. // CHECK:STDERR: SmallStructParam({.f = 5, .g = 6, .h = 7});
  85. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. // CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  87. // CHECK:STDERR: fn SmallStructParam[T:! type](unused x: {.f: T, .g: i32}) {}
  88. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  89. // CHECK:STDERR:
  90. SmallStructParam({.f = 5, .g = 6, .h = 7});
  91. }
  92. // --- fail_deduce_struct_wrong_name.carbon
  93. library "[[@TEST_NAME]]";
  94. fn WrongNameStructParam[T:! type](unused x: {.i: T, .different: i32}) {}
  95. fn CallWrongNameStructParam() {
  96. // CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  97. // CHECK:STDERR: WrongNameStructParam({.i = 8, .j = 9});
  98. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  99. // CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  100. // CHECK:STDERR: fn WrongNameStructParam[T:! type](unused x: {.i: T, .different: i32}) {}
  101. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  102. // CHECK:STDERR:
  103. WrongNameStructParam({.i = 8, .j = 9});
  104. }
  105. // --- fail_todo_deduce_struct_wrong_order.carbon
  106. library "[[@TEST_NAME]]";
  107. fn WrongOrderStructParam[T:! type](unused x: {.first: T, .second: i32}) {}
  108. fn CallWrongOrderStructParam() {
  109. // CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  110. // CHECK:STDERR: WrongOrderStructParam({.second = 11, .first = 10});
  111. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  112. // CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  113. // CHECK:STDERR: fn WrongOrderStructParam[T:! type](unused x: {.first: T, .second: i32}) {}
  114. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  115. // CHECK:STDERR:
  116. WrongOrderStructParam({.second = 11, .first = 10});
  117. }
  118. // --- fail_deduce_incomplete.carbon
  119. library "[[@TEST_NAME]]";
  120. // TODO: It would be nice to diagnose this at its point of declaration, because
  121. // U is not deducible.
  122. fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U;
  123. fn CallImplicitNotDeducible() {
  124. // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `U` [DeductionIncomplete]
  125. // CHECK:STDERR: ImplicitNotDeducible(42);
  126. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
  127. // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  128. // CHECK:STDERR: fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U;
  129. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  130. // CHECK:STDERR:
  131. ImplicitNotDeducible(42);
  132. }
  133. // --- fail_deduce_inconsistent.carbon
  134. library "[[@TEST_NAME]]";
  135. fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T;
  136. fn CallImplicitNotDeducible() {
  137. // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+7]]:3: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent]
  138. // CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12});
  139. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  140. // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  141. // CHECK:STDERR: fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T;
  142. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  143. // CHECK:STDERR:
  144. ImplicitNotDeducible(42, {.x = 12});
  145. }
  146. // --- deduce_nested_generic_class.carbon
  147. library "[[@TEST_NAME]]";
  148. interface Z {}
  149. class EE {}
  150. impl EE as Z {}
  151. class DD(E:! type) {}
  152. impl forall [E:! type] DD(E) as Z {}
  153. class CC(D:! Z) {}
  154. impl forall [E:! type] CC(DD(E)) as Z {}
  155. fn F() {
  156. CC(DD(EE)) as Z;
  157. }
  158. // CHECK:STDOUT: --- deduce_explicit.carbon
  159. // CHECK:STDOUT:
  160. // CHECK:STDOUT: constants {
  161. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  162. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  163. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  164. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  165. // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T [symbolic]
  166. // CHECK:STDOUT: %.cb6: Core.Form = init_form %ptr.e8f [symbolic]
  167. // CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic]
  168. // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [concrete]
  169. // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [concrete]
  170. // CHECK:STDOUT: %require_complete.ef1: <witness> = require_complete_type %ptr.e8f [symbolic]
  171. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.409: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic]
  172. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  173. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  174. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  175. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  176. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
  177. // CHECK:STDOUT: %.605: Core.Form = init_form %ptr.235 [concrete]
  178. // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete]
  179. // CHECK:STDOUT: %CallExplicitGenericParam.type: type = fn_type @CallExplicitGenericParam [concrete]
  180. // CHECK:STDOUT: %CallExplicitGenericParam: %CallExplicitGenericParam.type = struct_value () [concrete]
  181. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.3d2: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%i32) [concrete]
  182. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic]
  183. // CHECK:STDOUT: %ptr.88d: type = ptr_type %struct_type.a [symbolic]
  184. // CHECK:STDOUT: %.edd: Core.Form = init_form %ptr.88d [symbolic]
  185. // CHECK:STDOUT: %pattern_type.1cb: type = pattern_type %ptr.88d [symbolic]
  186. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.type: type = fn_type @CallExplicitGenericParamWithGenericArg [concrete]
  187. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg: %CallExplicitGenericParamWithGenericArg.type = struct_value () [concrete]
  188. // CHECK:STDOUT: %require_complete.61f: <witness> = require_complete_type %ptr.88d [symbolic]
  189. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.55c: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a) [symbolic]
  190. // CHECK:STDOUT: %complete_type.3d0: <witness> = complete_type_witness %ptr.235 [concrete]
  191. // CHECK:STDOUT: }
  192. // CHECK:STDOUT:
  193. // CHECK:STDOUT: imports {
  194. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  195. // CHECK:STDOUT: .Int = %Core.Int
  196. // CHECK:STDOUT: import Core//prelude
  197. // CHECK:STDOUT: import Core//prelude/...
  198. // CHECK:STDOUT: }
  199. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  200. // CHECK:STDOUT: }
  201. // CHECK:STDOUT:
  202. // CHECK:STDOUT: file {
  203. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  204. // CHECK:STDOUT: .Core = imports.%Core
  205. // CHECK:STDOUT: .ExplicitGenericParam = %ExplicitGenericParam.decl
  206. // CHECK:STDOUT: .CallExplicitGenericParam = %CallExplicitGenericParam.decl
  207. // CHECK:STDOUT: .CallExplicitGenericParamWithGenericArg = %CallExplicitGenericParamWithGenericArg.decl
  208. // CHECK:STDOUT: }
  209. // CHECK:STDOUT: %Core.import = import Core
  210. // CHECK:STDOUT: %ExplicitGenericParam.decl: %ExplicitGenericParam.type = fn_decl @ExplicitGenericParam [concrete = constants.%ExplicitGenericParam] {
  211. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  212. // CHECK:STDOUT: %return.param_patt: @ExplicitGenericParam.%pattern_type (%pattern_type.4f4) = out_param_pattern [concrete]
  213. // CHECK:STDOUT: %return.patt: @ExplicitGenericParam.%pattern_type (%pattern_type.4f4) = return_slot_pattern %return.param_patt, %ptr.loc4_39.2 [concrete]
  214. // CHECK:STDOUT: } {
  215. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  216. // CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type %T.ref.loc4_38 [symbolic = %ptr.loc4_39.1 (constants.%ptr.e8f)]
  217. // CHECK:STDOUT: %.loc4_39.2: Core.Form = init_form %ptr.loc4_39.2 [symbolic = %.loc4_39.1 (constants.%.cb6)]
  218. // CHECK:STDOUT: %.loc4_29.1: type = splice_block %.loc4_29.2 [concrete = type] {
  219. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  220. // CHECK:STDOUT: %.loc4_29.2: type = type_literal type [concrete = type]
  221. // CHECK:STDOUT: }
  222. // CHECK:STDOUT: %T.loc4_26.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  223. // CHECK:STDOUT: %return.param: ref @ExplicitGenericParam.%ptr.loc4_39.1 (%ptr.e8f) = out_param call_param0
  224. // CHECK:STDOUT: %return: ref @ExplicitGenericParam.%ptr.loc4_39.1 (%ptr.e8f) = return_slot %return.param
  225. // CHECK:STDOUT: }
  226. // CHECK:STDOUT: %CallExplicitGenericParam.decl: %CallExplicitGenericParam.type = fn_decl @CallExplicitGenericParam [concrete = constants.%CallExplicitGenericParam] {
  227. // CHECK:STDOUT: %return.param_patt: %pattern_type.fe8 = out_param_pattern [concrete]
  228. // CHECK:STDOUT: %return.patt: %pattern_type.fe8 = return_slot_pattern %return.param_patt, %ptr [concrete]
  229. // CHECK:STDOUT: } {
  230. // CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
  231. // CHECK:STDOUT: %ptr: type = ptr_type %i32.loc6 [concrete = constants.%ptr.235]
  232. // CHECK:STDOUT: %.loc6: Core.Form = init_form %ptr [concrete = constants.%.605]
  233. // CHECK:STDOUT: %return.param: ref %ptr.235 = out_param call_param0
  234. // CHECK:STDOUT: %return: ref %ptr.235 = return_slot %return.param
  235. // CHECK:STDOUT: }
  236. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.decl: %CallExplicitGenericParamWithGenericArg.type = fn_decl @CallExplicitGenericParamWithGenericArg [concrete = constants.%CallExplicitGenericParamWithGenericArg] {
  237. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  238. // CHECK:STDOUT: %return.param_patt: @CallExplicitGenericParamWithGenericArg.%pattern_type (%pattern_type.1cb) = out_param_pattern [concrete]
  239. // CHECK:STDOUT: %return.patt: @CallExplicitGenericParamWithGenericArg.%pattern_type (%pattern_type.1cb) = return_slot_pattern %return.param_patt, %ptr.loc10_63.2 [concrete]
  240. // CHECK:STDOUT: } {
  241. // CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc10_44.2 [symbolic = %T.loc10_44.1 (constants.%T)]
  242. // CHECK:STDOUT: %struct_type.a.loc10_62.2: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_44.1 (%T)} [symbolic = %struct_type.a.loc10_62.1 (constants.%struct_type.a)]
  243. // CHECK:STDOUT: %ptr.loc10_63.2: type = ptr_type %struct_type.a.loc10_62.2 [symbolic = %ptr.loc10_63.1 (constants.%ptr.88d)]
  244. // CHECK:STDOUT: %.loc10_63.2: Core.Form = init_form %ptr.loc10_63.2 [symbolic = %.loc10_63.1 (constants.%.edd)]
  245. // CHECK:STDOUT: %.loc10_47.1: type = splice_block %.loc10_47.2 [concrete = type] {
  246. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  247. // CHECK:STDOUT: %.loc10_47.2: type = type_literal type [concrete = type]
  248. // CHECK:STDOUT: }
  249. // CHECK:STDOUT: %T.loc10_44.2: type = symbolic_binding T, 0 [symbolic = %T.loc10_44.1 (constants.%T)]
  250. // CHECK:STDOUT: %return.param: ref @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.1 (%ptr.88d) = out_param call_param0
  251. // CHECK:STDOUT: %return: ref @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.1 (%ptr.88d) = return_slot %return.param
  252. // CHECK:STDOUT: }
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: generic fn @ExplicitGenericParam(%T.loc4_26.2: type) {
  256. // CHECK:STDOUT: %T.loc4_26.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  257. // CHECK:STDOUT: %ptr.loc4_39.1: type = ptr_type %T.loc4_26.1 [symbolic = %ptr.loc4_39.1 (constants.%ptr.e8f)]
  258. // CHECK:STDOUT: %.loc4_39.1: Core.Form = init_form %ptr.loc4_39.1 [symbolic = %.loc4_39.1 (constants.%.cb6)]
  259. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc4_39.1 [symbolic = %pattern_type (constants.%pattern_type.4f4)]
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: !definition:
  262. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc4_39.1 [symbolic = %require_complete (constants.%require_complete.ef1)]
  263. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_26.1) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn.409)]
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: fn() -> out %return.param: @ExplicitGenericParam.%ptr.loc4_39.1 (%ptr.e8f) {
  266. // CHECK:STDOUT: !entry:
  267. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  268. // CHECK:STDOUT: %T.ref.loc4_71: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  269. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.1: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%T) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn.409)]
  270. // CHECK:STDOUT: %ExplicitGenericParam.call: init @ExplicitGenericParam.%ptr.loc4_39.1 (%ptr.e8f) = call %ExplicitGenericParam.specific_fn.loc4_50.1()
  271. // CHECK:STDOUT: return %ExplicitGenericParam.call
  272. // CHECK:STDOUT: }
  273. // CHECK:STDOUT: }
  274. // CHECK:STDOUT:
  275. // CHECK:STDOUT: fn @CallExplicitGenericParam() -> out %return.param: %ptr.235 {
  276. // CHECK:STDOUT: !entry:
  277. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  278. // CHECK:STDOUT: %i32.loc7: type = type_literal constants.%i32 [concrete = constants.%i32]
  279. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%i32) [concrete = constants.%ExplicitGenericParam.specific_fn.3d2]
  280. // CHECK:STDOUT: %ExplicitGenericParam.call: init %ptr.235 = call %ExplicitGenericParam.specific_fn()
  281. // CHECK:STDOUT: return %ExplicitGenericParam.call
  282. // CHECK:STDOUT: }
  283. // CHECK:STDOUT:
  284. // CHECK:STDOUT: generic fn @CallExplicitGenericParamWithGenericArg(%T.loc10_44.2: type) {
  285. // CHECK:STDOUT: %T.loc10_44.1: type = symbolic_binding T, 0 [symbolic = %T.loc10_44.1 (constants.%T)]
  286. // CHECK:STDOUT: %struct_type.a.loc10_62.1: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_44.1 (%T)} [symbolic = %struct_type.a.loc10_62.1 (constants.%struct_type.a)]
  287. // CHECK:STDOUT: %ptr.loc10_63.1: type = ptr_type %struct_type.a.loc10_62.1 [symbolic = %ptr.loc10_63.1 (constants.%ptr.88d)]
  288. // CHECK:STDOUT: %.loc10_63.1: Core.Form = init_form %ptr.loc10_63.1 [symbolic = %.loc10_63.1 (constants.%.edd)]
  289. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc10_63.1 [symbolic = %pattern_type (constants.%pattern_type.1cb)]
  290. // CHECK:STDOUT:
  291. // CHECK:STDOUT: !definition:
  292. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc10_63.1 [symbolic = %require_complete (constants.%require_complete.61f)]
  293. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc11_10.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a.loc10_62.1) [symbolic = %ExplicitGenericParam.specific_fn.loc11_10.2 (constants.%ExplicitGenericParam.specific_fn.55c)]
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: fn() -> out %return.param: @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.1 (%ptr.88d) {
  296. // CHECK:STDOUT: !entry:
  297. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  298. // CHECK:STDOUT: %T.ref.loc11: type = name_ref T, %T.loc10_44.2 [symbolic = %T.loc10_44.1 (constants.%T)]
  299. // CHECK:STDOUT: %struct_type.a.loc11: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_44.1 (%T)} [symbolic = %struct_type.a.loc10_62.1 (constants.%struct_type.a)]
  300. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc11_10.1: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%struct_type.a) [symbolic = %ExplicitGenericParam.specific_fn.loc11_10.2 (constants.%ExplicitGenericParam.specific_fn.55c)]
  301. // CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.1 (%ptr.88d) = call %ExplicitGenericParam.specific_fn.loc11_10.1()
  302. // CHECK:STDOUT: return %ExplicitGenericParam.call
  303. // CHECK:STDOUT: }
  304. // CHECK:STDOUT: }
  305. // CHECK:STDOUT:
  306. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%T) {
  307. // CHECK:STDOUT: %T.loc4_26.1 => constants.%T
  308. // CHECK:STDOUT: %ptr.loc4_39.1 => constants.%ptr.e8f
  309. // CHECK:STDOUT: %.loc4_39.1 => constants.%.cb6
  310. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: !definition:
  313. // CHECK:STDOUT: %require_complete => constants.%require_complete.ef1
  314. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.409
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%i32) {
  318. // CHECK:STDOUT: %T.loc4_26.1 => constants.%i32
  319. // CHECK:STDOUT: %ptr.loc4_39.1 => constants.%ptr.235
  320. // CHECK:STDOUT: %.loc4_39.1 => constants.%.605
  321. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.fe8
  322. // CHECK:STDOUT:
  323. // CHECK:STDOUT: !definition:
  324. // CHECK:STDOUT: %require_complete => constants.%complete_type.3d0
  325. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.3d2
  326. // CHECK:STDOUT: }
  327. // CHECK:STDOUT:
  328. // CHECK:STDOUT: specific @CallExplicitGenericParamWithGenericArg(constants.%T) {
  329. // CHECK:STDOUT: %T.loc10_44.1 => constants.%T
  330. // CHECK:STDOUT: %struct_type.a.loc10_62.1 => constants.%struct_type.a
  331. // CHECK:STDOUT: %ptr.loc10_63.1 => constants.%ptr.88d
  332. // CHECK:STDOUT: %.loc10_63.1 => constants.%.edd
  333. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1cb
  334. // CHECK:STDOUT: }
  335. // CHECK:STDOUT:
  336. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%struct_type.a) {
  337. // CHECK:STDOUT: %T.loc4_26.1 => constants.%struct_type.a
  338. // CHECK:STDOUT: %ptr.loc4_39.1 => constants.%ptr.88d
  339. // CHECK:STDOUT: %.loc4_39.1 => constants.%.edd
  340. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1cb
  341. // CHECK:STDOUT:
  342. // CHECK:STDOUT: !definition:
  343. // CHECK:STDOUT: %require_complete => constants.%require_complete.61f
  344. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.55c
  345. // CHECK:STDOUT: }
  346. // CHECK:STDOUT:
  347. // CHECK:STDOUT: --- fail_deduce_explicit_non_constant.carbon
  348. // CHECK:STDOUT:
  349. // CHECK:STDOUT: constants {
  350. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  351. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  352. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  353. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  354. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
  355. // CHECK:STDOUT: %.cb6: Core.Form = init_form %ptr [symbolic]
  356. // CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr [symbolic]
  357. // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [concrete]
  358. // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [concrete]
  359. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr [symbolic]
  360. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic]
  361. // CHECK:STDOUT: %CallExplicitGenericParamConst.type: type = fn_type @CallExplicitGenericParamConst [concrete]
  362. // CHECK:STDOUT: %CallExplicitGenericParamConst: %CallExplicitGenericParamConst.type = struct_value () [concrete]
  363. // CHECK:STDOUT: %CallExplicitGenericParamNonConst.type: type = fn_type @CallExplicitGenericParamNonConst [concrete]
  364. // CHECK:STDOUT: %CallExplicitGenericParamNonConst: %CallExplicitGenericParamNonConst.type = struct_value () [concrete]
  365. // CHECK:STDOUT: }
  366. // CHECK:STDOUT:
  367. // CHECK:STDOUT: imports {
  368. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  369. // CHECK:STDOUT: import Core//prelude
  370. // CHECK:STDOUT: import Core//prelude/...
  371. // CHECK:STDOUT: }
  372. // CHECK:STDOUT: }
  373. // CHECK:STDOUT:
  374. // CHECK:STDOUT: file {
  375. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  376. // CHECK:STDOUT: .Core = imports.%Core
  377. // CHECK:STDOUT: .ExplicitGenericParam = %ExplicitGenericParam.decl
  378. // CHECK:STDOUT: .CallExplicitGenericParamConst = %CallExplicitGenericParamConst.decl
  379. // CHECK:STDOUT: .CallExplicitGenericParamNonConst = %CallExplicitGenericParamNonConst.decl
  380. // CHECK:STDOUT: }
  381. // CHECK:STDOUT: %Core.import = import Core
  382. // CHECK:STDOUT: %ExplicitGenericParam.decl: %ExplicitGenericParam.type = fn_decl @ExplicitGenericParam [concrete = constants.%ExplicitGenericParam] {
  383. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  384. // CHECK:STDOUT: %return.param_patt: @ExplicitGenericParam.%pattern_type (%pattern_type.4f4) = out_param_pattern [concrete]
  385. // CHECK:STDOUT: %return.patt: @ExplicitGenericParam.%pattern_type (%pattern_type.4f4) = return_slot_pattern %return.param_patt, %ptr.loc4_39.2 [concrete]
  386. // CHECK:STDOUT: } {
  387. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  388. // CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type %T.ref.loc4_38 [symbolic = %ptr.loc4_39.1 (constants.%ptr)]
  389. // CHECK:STDOUT: %.loc4_39.2: Core.Form = init_form %ptr.loc4_39.2 [symbolic = %.loc4_39.1 (constants.%.cb6)]
  390. // CHECK:STDOUT: %.loc4_29.1: type = splice_block %.loc4_29.2 [concrete = type] {
  391. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  392. // CHECK:STDOUT: %.loc4_29.2: type = type_literal type [concrete = type]
  393. // CHECK:STDOUT: }
  394. // CHECK:STDOUT: %T.loc4_26.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  395. // CHECK:STDOUT: %return.param: ref @ExplicitGenericParam.%ptr.loc4_39.1 (%ptr) = out_param call_param0
  396. // CHECK:STDOUT: %return: ref @ExplicitGenericParam.%ptr.loc4_39.1 (%ptr) = return_slot %return.param
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT: %CallExplicitGenericParamConst.decl: %CallExplicitGenericParamConst.type = fn_decl @CallExplicitGenericParamConst [concrete = constants.%CallExplicitGenericParamConst] {
  399. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  400. // CHECK:STDOUT: } {
  401. // CHECK:STDOUT: %.loc6_38.1: type = splice_block %.loc6_38.2 [concrete = type] {
  402. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  403. // CHECK:STDOUT: %.loc6_38.2: type = type_literal type [concrete = type]
  404. // CHECK:STDOUT: }
  405. // CHECK:STDOUT: %T.loc6_35.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_35.1 (constants.%T)]
  406. // CHECK:STDOUT: }
  407. // CHECK:STDOUT: %CallExplicitGenericParamNonConst.decl: %CallExplicitGenericParamNonConst.type = fn_decl @CallExplicitGenericParamNonConst [concrete = constants.%CallExplicitGenericParamNonConst] {
  408. // CHECK:STDOUT: %T.param_patt: %pattern_type.98f = value_param_pattern [concrete]
  409. // CHECK:STDOUT: %T.patt: %pattern_type.98f = at_binding_pattern T, %T.param_patt [concrete]
  410. // CHECK:STDOUT: } {
  411. // CHECK:STDOUT: %T.param: type = value_param call_param0
  412. // CHECK:STDOUT: %.loc10: type = type_literal type [concrete = type]
  413. // CHECK:STDOUT: %T: type = value_binding T, %T.param
  414. // CHECK:STDOUT: }
  415. // CHECK:STDOUT: }
  416. // CHECK:STDOUT:
  417. // CHECK:STDOUT: generic fn @ExplicitGenericParam(%T.loc4_26.2: type) {
  418. // CHECK:STDOUT: %T.loc4_26.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  419. // CHECK:STDOUT: %ptr.loc4_39.1: type = ptr_type %T.loc4_26.1 [symbolic = %ptr.loc4_39.1 (constants.%ptr)]
  420. // CHECK:STDOUT: %.loc4_39.1: Core.Form = init_form %ptr.loc4_39.1 [symbolic = %.loc4_39.1 (constants.%.cb6)]
  421. // CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc4_39.1 [symbolic = %pattern_type (constants.%pattern_type.4f4)]
  422. // CHECK:STDOUT:
  423. // CHECK:STDOUT: !definition:
  424. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc4_39.1 [symbolic = %require_complete (constants.%require_complete)]
  425. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_26.1) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn)]
  426. // CHECK:STDOUT:
  427. // CHECK:STDOUT: fn() -> out %return.param: @ExplicitGenericParam.%ptr.loc4_39.1 (%ptr) {
  428. // CHECK:STDOUT: !entry:
  429. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  430. // CHECK:STDOUT: %T.ref.loc4_71: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  431. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.1: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%T) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn)]
  432. // CHECK:STDOUT: %ExplicitGenericParam.call: init @ExplicitGenericParam.%ptr.loc4_39.1 (%ptr) = call %ExplicitGenericParam.specific_fn.loc4_50.1()
  433. // CHECK:STDOUT: return %ExplicitGenericParam.call
  434. // CHECK:STDOUT: }
  435. // CHECK:STDOUT: }
  436. // CHECK:STDOUT:
  437. // CHECK:STDOUT: generic fn @CallExplicitGenericParamConst(%T.loc6_35.2: type) {
  438. // CHECK:STDOUT: %T.loc6_35.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_35.1 (constants.%T)]
  439. // CHECK:STDOUT:
  440. // CHECK:STDOUT: !definition:
  441. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc7_3.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc6_35.1) [symbolic = %ExplicitGenericParam.specific_fn.loc7_3.2 (constants.%ExplicitGenericParam.specific_fn)]
  442. // CHECK:STDOUT: %ptr: type = ptr_type %T.loc6_35.1 [symbolic = %ptr (constants.%ptr)]
  443. // CHECK:STDOUT:
  444. // CHECK:STDOUT: fn() {
  445. // CHECK:STDOUT: !entry:
  446. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  447. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_35.2 [symbolic = %T.loc6_35.1 (constants.%T)]
  448. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc7_3.1: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%T) [symbolic = %ExplicitGenericParam.specific_fn.loc7_3.2 (constants.%ExplicitGenericParam.specific_fn)]
  449. // CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamConst.%ptr (%ptr) = call %ExplicitGenericParam.specific_fn.loc7_3.1()
  450. // CHECK:STDOUT: return
  451. // CHECK:STDOUT: }
  452. // CHECK:STDOUT: }
  453. // CHECK:STDOUT:
  454. // CHECK:STDOUT: fn @CallExplicitGenericParamNonConst(%T.param: type) {
  455. // CHECK:STDOUT: !entry:
  456. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [concrete = constants.%ExplicitGenericParam]
  457. // CHECK:STDOUT: %T.ref: type = name_ref T, %T
  458. // CHECK:STDOUT: return
  459. // CHECK:STDOUT: }
  460. // CHECK:STDOUT:
  461. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%T) {
  462. // CHECK:STDOUT: %T.loc4_26.1 => constants.%T
  463. // CHECK:STDOUT: %ptr.loc4_39.1 => constants.%ptr
  464. // CHECK:STDOUT: %.loc4_39.1 => constants.%.cb6
  465. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4
  466. // CHECK:STDOUT:
  467. // CHECK:STDOUT: !definition:
  468. // CHECK:STDOUT: %require_complete => constants.%require_complete
  469. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn
  470. // CHECK:STDOUT: }
  471. // CHECK:STDOUT:
  472. // CHECK:STDOUT: specific @CallExplicitGenericParamConst(constants.%T) {
  473. // CHECK:STDOUT: %T.loc6_35.1 => constants.%T
  474. // CHECK:STDOUT: }
  475. // CHECK:STDOUT:
  476. // CHECK:STDOUT: --- explicit_vs_deduced.carbon
  477. // CHECK:STDOUT:
  478. // CHECK:STDOUT: constants {
  479. // CHECK:STDOUT: %A: type = class_type @A [concrete]
  480. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  481. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
  482. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  483. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  484. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  485. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  486. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
  487. // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T [symbolic]
  488. // CHECK:STDOUT: %.cb6: Core.Form = init_form %ptr.e8f [symbolic]
  489. // CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic]
  490. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.type: type = fn_type @ExplicitAndAlsoDeduced [concrete]
  491. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  492. // CHECK:STDOUT: %ExplicitAndAlsoDeduced: %ExplicitAndAlsoDeduced.type = struct_value () [concrete]
  493. // CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T [symbolic]
  494. // CHECK:STDOUT: %require_complete.ef1: <witness> = require_complete_type %ptr.e8f [symbolic]
  495. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.7e7: <specific function> = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T) [symbolic]
  496. // CHECK:STDOUT: %ptr.643: type = ptr_type %A [concrete]
  497. // CHECK:STDOUT: %.ebf: Core.Form = init_form %ptr.643 [concrete]
  498. // CHECK:STDOUT: %pattern_type.f29: type = pattern_type %ptr.643 [concrete]
  499. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.type: type = fn_type @CallExplicitAndAlsoDeduced [concrete]
  500. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced: %CallExplicitAndAlsoDeduced.type = struct_value () [concrete]
  501. // CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
  502. // CHECK:STDOUT: %pattern_type.1ab: type = pattern_type %A [concrete]
  503. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.1f3: <specific function> = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%A) [concrete]
  504. // CHECK:STDOUT: %A.val: %A = struct_value () [concrete]
  505. // CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
  506. // CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete]
  507. // CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete]
  508. // CHECK:STDOUT: %complete_type.8a0: <witness> = complete_type_witness %ptr.643 [concrete]
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT:
  511. // CHECK:STDOUT: imports {
  512. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  513. // CHECK:STDOUT: .Destroy = %Core.Destroy
  514. // CHECK:STDOUT: import Core//prelude
  515. // CHECK:STDOUT: import Core//prelude/...
  516. // CHECK:STDOUT: }
  517. // CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
  518. // CHECK:STDOUT: }
  519. // CHECK:STDOUT:
  520. // CHECK:STDOUT: file {
  521. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  522. // CHECK:STDOUT: .Core = imports.%Core
  523. // CHECK:STDOUT: .A = %A.decl
  524. // CHECK:STDOUT: .ExplicitAndAlsoDeduced = %ExplicitAndAlsoDeduced.decl
  525. // CHECK:STDOUT: .CallExplicitAndAlsoDeduced = %CallExplicitAndAlsoDeduced.decl
  526. // CHECK:STDOUT: }
  527. // CHECK:STDOUT: %Core.import = import Core
  528. // CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
  529. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.decl: %ExplicitAndAlsoDeduced.type = fn_decl @ExplicitAndAlsoDeduced [concrete = constants.%ExplicitAndAlsoDeduced] {
  530. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  531. // CHECK:STDOUT: %x.param_patt: @ExplicitAndAlsoDeduced.%pattern_type.loc6_38 (%pattern_type.51d) = value_param_pattern [concrete]
  532. // CHECK:STDOUT: %x.patt: @ExplicitAndAlsoDeduced.%pattern_type.loc6_38 (%pattern_type.51d) = at_binding_pattern x, %x.param_patt [concrete]
  533. // CHECK:STDOUT: %return.param_patt: @ExplicitAndAlsoDeduced.%pattern_type.loc6_47 (%pattern_type.4f4) = out_param_pattern [concrete]
  534. // CHECK:STDOUT: %return.patt: @ExplicitAndAlsoDeduced.%pattern_type.loc6_47 (%pattern_type.4f4) = return_slot_pattern %return.param_patt, %ptr.loc6_47.2 [concrete]
  535. // CHECK:STDOUT: } {
  536. // CHECK:STDOUT: %T.ref.loc6_46: type = name_ref T, %T.loc6_28.2 [symbolic = %T.loc6_28.1 (constants.%T)]
  537. // CHECK:STDOUT: %ptr.loc6_47.2: type = ptr_type %T.ref.loc6_46 [symbolic = %ptr.loc6_47.1 (constants.%ptr.e8f)]
  538. // CHECK:STDOUT: %.loc6_47.2: Core.Form = init_form %ptr.loc6_47.2 [symbolic = %.loc6_47.1 (constants.%.cb6)]
  539. // CHECK:STDOUT: %.loc6_31.1: type = splice_block %.loc6_31.2 [concrete = type] {
  540. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  541. // CHECK:STDOUT: %.loc6_31.2: type = type_literal type [concrete = type]
  542. // CHECK:STDOUT: }
  543. // CHECK:STDOUT: %T.loc6_28.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_28.1 (constants.%T)]
  544. // CHECK:STDOUT: %x.param: @ExplicitAndAlsoDeduced.%T.loc6_28.1 (%T) = value_param call_param0
  545. // CHECK:STDOUT: %T.ref.loc6_40: type = name_ref T, %T.loc6_28.2 [symbolic = %T.loc6_28.1 (constants.%T)]
  546. // CHECK:STDOUT: %x: @ExplicitAndAlsoDeduced.%T.loc6_28.1 (%T) = value_binding x, %x.param
  547. // CHECK:STDOUT: %return.param: ref @ExplicitAndAlsoDeduced.%ptr.loc6_47.1 (%ptr.e8f) = out_param call_param1
  548. // CHECK:STDOUT: %return: ref @ExplicitAndAlsoDeduced.%ptr.loc6_47.1 (%ptr.e8f) = return_slot %return.param
  549. // CHECK:STDOUT: }
  550. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.decl: %CallExplicitAndAlsoDeduced.type = fn_decl @CallExplicitAndAlsoDeduced [concrete = constants.%CallExplicitAndAlsoDeduced] {
  551. // CHECK:STDOUT: %return.param_patt: %pattern_type.f29 = out_param_pattern [concrete]
  552. // CHECK:STDOUT: %return.patt: %pattern_type.f29 = return_slot_pattern %return.param_patt, %ptr [concrete]
  553. // CHECK:STDOUT: } {
  554. // CHECK:STDOUT: %A.ref.loc10: type = name_ref A, file.%A.decl [concrete = constants.%A]
  555. // CHECK:STDOUT: %ptr: type = ptr_type %A.ref.loc10 [concrete = constants.%ptr.643]
  556. // CHECK:STDOUT: %.loc10: Core.Form = init_form %ptr [concrete = constants.%.ebf]
  557. // CHECK:STDOUT: %return.param: ref %ptr.643 = out_param call_param0
  558. // CHECK:STDOUT: %return: ref %ptr.643 = return_slot %return.param
  559. // CHECK:STDOUT: }
  560. // CHECK:STDOUT: }
  561. // CHECK:STDOUT:
  562. // CHECK:STDOUT: class @A {
  563. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
  564. // CHECK:STDOUT: complete_type_witness = %complete_type
  565. // CHECK:STDOUT:
  566. // CHECK:STDOUT: !members:
  567. // CHECK:STDOUT: .Self = constants.%A
  568. // CHECK:STDOUT: }
  569. // CHECK:STDOUT:
  570. // CHECK:STDOUT: generic fn @ExplicitAndAlsoDeduced(%T.loc6_28.2: type) {
  571. // CHECK:STDOUT: %T.loc6_28.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_28.1 (constants.%T)]
  572. // CHECK:STDOUT: %pattern_type.loc6_38: type = pattern_type %T.loc6_28.1 [symbolic = %pattern_type.loc6_38 (constants.%pattern_type.51d)]
  573. // CHECK:STDOUT: %ptr.loc6_47.1: type = ptr_type %T.loc6_28.1 [symbolic = %ptr.loc6_47.1 (constants.%ptr.e8f)]
  574. // CHECK:STDOUT: %.loc6_47.1: Core.Form = init_form %ptr.loc6_47.1 [symbolic = %.loc6_47.1 (constants.%.cb6)]
  575. // CHECK:STDOUT: %pattern_type.loc6_47: type = pattern_type %ptr.loc6_47.1 [symbolic = %pattern_type.loc6_47 (constants.%pattern_type.4f4)]
  576. // CHECK:STDOUT:
  577. // CHECK:STDOUT: !definition:
  578. // CHECK:STDOUT: %require_complete.loc6_38: <witness> = require_complete_type %T.loc6_28.1 [symbolic = %require_complete.loc6_38 (constants.%require_complete.944)]
  579. // CHECK:STDOUT: %require_complete.loc6_47: <witness> = require_complete_type %ptr.loc6_47.1 [symbolic = %require_complete.loc6_47 (constants.%require_complete.ef1)]
  580. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2: <specific function> = specific_function constants.%ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T.loc6_28.1) [symbolic = %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 (constants.%ExplicitAndAlsoDeduced.specific_fn.7e7)]
  581. // CHECK:STDOUT:
  582. // CHECK:STDOUT: fn(%x.param: @ExplicitAndAlsoDeduced.%T.loc6_28.1 (%T)) -> out %return.param: @ExplicitAndAlsoDeduced.%ptr.loc6_47.1 (%ptr.e8f) {
  583. // CHECK:STDOUT: !entry:
  584. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.ref: %ExplicitAndAlsoDeduced.type = name_ref ExplicitAndAlsoDeduced, file.%ExplicitAndAlsoDeduced.decl [concrete = constants.%ExplicitAndAlsoDeduced]
  585. // CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc6_28.2 [symbolic = %T.loc6_28.1 (constants.%T)]
  586. // CHECK:STDOUT: %x.ref: @ExplicitAndAlsoDeduced.%T.loc6_28.1 (%T) = name_ref x, %x
  587. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.1: <specific function> = specific_function %ExplicitAndAlsoDeduced.ref, @ExplicitAndAlsoDeduced(constants.%T) [symbolic = %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 (constants.%ExplicitAndAlsoDeduced.specific_fn.7e7)]
  588. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init @ExplicitAndAlsoDeduced.%ptr.loc6_47.1 (%ptr.e8f) = call %ExplicitAndAlsoDeduced.specific_fn.loc7_10.1(%x.ref)
  589. // CHECK:STDOUT: return %ExplicitAndAlsoDeduced.call
  590. // CHECK:STDOUT: }
  591. // CHECK:STDOUT: }
  592. // CHECK:STDOUT:
  593. // CHECK:STDOUT: fn @CallExplicitAndAlsoDeduced() -> out %return.param: %ptr.643 {
  594. // CHECK:STDOUT: !entry:
  595. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.ref: %ExplicitAndAlsoDeduced.type = name_ref ExplicitAndAlsoDeduced, file.%ExplicitAndAlsoDeduced.decl [concrete = constants.%ExplicitAndAlsoDeduced]
  596. // CHECK:STDOUT: %A.ref.loc11: type = name_ref A, file.%A.decl [concrete = constants.%A]
  597. // CHECK:STDOUT: %.loc11_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
  598. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn: <specific function> = specific_function %ExplicitAndAlsoDeduced.ref, @ExplicitAndAlsoDeduced(constants.%A) [concrete = constants.%ExplicitAndAlsoDeduced.specific_fn.1f3]
  599. // CHECK:STDOUT: %.loc11_37.2: ref %A = temporary_storage
  600. // CHECK:STDOUT: %.loc11_37.3: init %A to %.loc11_37.2 = class_init () [concrete = constants.%A.val]
  601. // CHECK:STDOUT: %.loc11_37.4: init %A = converted %.loc11_37.1, %.loc11_37.3 [concrete = constants.%A.val]
  602. // CHECK:STDOUT: %.loc11_37.5: ref %A = temporary %.loc11_37.2, %.loc11_37.4
  603. // CHECK:STDOUT: %.loc11_37.6: %A = acquire_value %.loc11_37.5
  604. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init %ptr.643 = call %ExplicitAndAlsoDeduced.specific_fn(%.loc11_37.6)
  605. // CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc11_37.5, constants.%Destroy.Op
  606. // CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc11_37.5)
  607. // CHECK:STDOUT: return %ExplicitAndAlsoDeduced.call
  608. // CHECK:STDOUT: }
  609. // CHECK:STDOUT:
  610. // CHECK:STDOUT: fn @Destroy.Op(%self.param: ref %A) = "no_op";
  611. // CHECK:STDOUT:
  612. // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%T) {
  613. // CHECK:STDOUT: %T.loc6_28.1 => constants.%T
  614. // CHECK:STDOUT: %pattern_type.loc6_38 => constants.%pattern_type.51d
  615. // CHECK:STDOUT: %ptr.loc6_47.1 => constants.%ptr.e8f
  616. // CHECK:STDOUT: %.loc6_47.1 => constants.%.cb6
  617. // CHECK:STDOUT: %pattern_type.loc6_47 => constants.%pattern_type.4f4
  618. // CHECK:STDOUT:
  619. // CHECK:STDOUT: !definition:
  620. // CHECK:STDOUT: %require_complete.loc6_38 => constants.%require_complete.944
  621. // CHECK:STDOUT: %require_complete.loc6_47 => constants.%require_complete.ef1
  622. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.7e7
  623. // CHECK:STDOUT: }
  624. // CHECK:STDOUT:
  625. // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%A) {
  626. // CHECK:STDOUT: %T.loc6_28.1 => constants.%A
  627. // CHECK:STDOUT: %pattern_type.loc6_38 => constants.%pattern_type.1ab
  628. // CHECK:STDOUT: %ptr.loc6_47.1 => constants.%ptr.643
  629. // CHECK:STDOUT: %.loc6_47.1 => constants.%.ebf
  630. // CHECK:STDOUT: %pattern_type.loc6_47 => constants.%pattern_type.f29
  631. // CHECK:STDOUT:
  632. // CHECK:STDOUT: !definition:
  633. // CHECK:STDOUT: %require_complete.loc6_38 => constants.%complete_type.357
  634. // CHECK:STDOUT: %require_complete.loc6_47 => constants.%complete_type.8a0
  635. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.1f3
  636. // CHECK:STDOUT: }
  637. // CHECK:STDOUT:
  638. // CHECK:STDOUT: --- deduce_implicit.carbon
  639. // CHECK:STDOUT:
  640. // CHECK:STDOUT: constants {
  641. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  642. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  643. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  644. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  645. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
  646. // CHECK:STDOUT: %ptr.e8f: type = ptr_type %T [symbolic]
  647. // CHECK:STDOUT: %.cb6: Core.Form = init_form %ptr.e8f [symbolic]
  648. // CHECK:STDOUT: %pattern_type.4f4: type = pattern_type %ptr.e8f [symbolic]
  649. // CHECK:STDOUT: %ImplicitGenericParam.type: type = fn_type @ImplicitGenericParam [concrete]
  650. // CHECK:STDOUT: %ImplicitGenericParam: %ImplicitGenericParam.type = struct_value () [concrete]
  651. // CHECK:STDOUT: %require_complete.944: <witness> = require_complete_type %T [symbolic]
  652. // CHECK:STDOUT: %require_complete.ef1: <witness> = require_complete_type %ptr.e8f [symbolic]
  653. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.7cc: <specific function> = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%T) [symbolic]
  654. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  655. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  656. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  657. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  658. // CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete]
  659. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
  660. // CHECK:STDOUT: %.605: Core.Form = init_form %ptr.235 [concrete]
  661. // CHECK:STDOUT: %pattern_type.fe8: type = pattern_type %ptr.235 [concrete]
  662. // CHECK:STDOUT: %CallImplicitGenericParam.type: type = fn_type @CallImplicitGenericParam [concrete]
  663. // CHECK:STDOUT: %CallImplicitGenericParam: %CallImplicitGenericParam.type = struct_value () [concrete]
  664. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [concrete]
  665. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [concrete]
  666. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.be5: <specific function> = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%i32) [concrete]
  667. // CHECK:STDOUT: %complete_type.3d0: <witness> = complete_type_witness %ptr.235 [concrete]
  668. // CHECK:STDOUT: }
  669. // CHECK:STDOUT:
  670. // CHECK:STDOUT: imports {
  671. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  672. // CHECK:STDOUT: .Int = %Core.Int
  673. // CHECK:STDOUT: import Core//prelude
  674. // CHECK:STDOUT: import Core//prelude/...
  675. // CHECK:STDOUT: }
  676. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  677. // CHECK:STDOUT: }
  678. // CHECK:STDOUT:
  679. // CHECK:STDOUT: file {
  680. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  681. // CHECK:STDOUT: .Core = imports.%Core
  682. // CHECK:STDOUT: .ImplicitGenericParam = %ImplicitGenericParam.decl
  683. // CHECK:STDOUT: .CallImplicitGenericParam = %CallImplicitGenericParam.decl
  684. // CHECK:STDOUT: }
  685. // CHECK:STDOUT: %Core.import = import Core
  686. // CHECK:STDOUT: %ImplicitGenericParam.decl: %ImplicitGenericParam.type = fn_decl @ImplicitGenericParam [concrete = constants.%ImplicitGenericParam] {
  687. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  688. // CHECK:STDOUT: %x.param_patt: @ImplicitGenericParam.%pattern_type.loc4_36 (%pattern_type.51d) = value_param_pattern [concrete]
  689. // CHECK:STDOUT: %x.patt: @ImplicitGenericParam.%pattern_type.loc4_36 (%pattern_type.51d) = at_binding_pattern x, %x.param_patt [concrete]
  690. // CHECK:STDOUT: %return.param_patt: @ImplicitGenericParam.%pattern_type.loc4_45 (%pattern_type.4f4) = out_param_pattern [concrete]
  691. // CHECK:STDOUT: %return.patt: @ImplicitGenericParam.%pattern_type.loc4_45 (%pattern_type.4f4) = return_slot_pattern %return.param_patt, %ptr.loc4_45.2 [concrete]
  692. // CHECK:STDOUT: } {
  693. // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  694. // CHECK:STDOUT: %ptr.loc4_45.2: type = ptr_type %T.ref.loc4_44 [symbolic = %ptr.loc4_45.1 (constants.%ptr.e8f)]
  695. // CHECK:STDOUT: %.loc4_45.2: Core.Form = init_form %ptr.loc4_45.2 [symbolic = %.loc4_45.1 (constants.%.cb6)]
  696. // CHECK:STDOUT: %.loc4_29.1: type = splice_block %.loc4_29.2 [concrete = type] {
  697. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  698. // CHECK:STDOUT: %.loc4_29.2: type = type_literal type [concrete = type]
  699. // CHECK:STDOUT: }
  700. // CHECK:STDOUT: %T.loc4_26.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  701. // CHECK:STDOUT: %x.param: @ImplicitGenericParam.%T.loc4_26.1 (%T) = value_param call_param0
  702. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  703. // CHECK:STDOUT: %x: @ImplicitGenericParam.%T.loc4_26.1 (%T) = value_binding x, %x.param
  704. // CHECK:STDOUT: %return.param: ref @ImplicitGenericParam.%ptr.loc4_45.1 (%ptr.e8f) = out_param call_param1
  705. // CHECK:STDOUT: %return: ref @ImplicitGenericParam.%ptr.loc4_45.1 (%ptr.e8f) = return_slot %return.param
  706. // CHECK:STDOUT: }
  707. // CHECK:STDOUT: %CallImplicitGenericParam.decl: %CallImplicitGenericParam.type = fn_decl @CallImplicitGenericParam [concrete = constants.%CallImplicitGenericParam] {
  708. // CHECK:STDOUT: %n.param_patt: %pattern_type.7ce = value_param_pattern [concrete]
  709. // CHECK:STDOUT: %n.patt: %pattern_type.7ce = at_binding_pattern n, %n.param_patt [concrete]
  710. // CHECK:STDOUT: %return.param_patt: %pattern_type.fe8 = out_param_pattern [concrete]
  711. // CHECK:STDOUT: %return.patt: %pattern_type.fe8 = return_slot_pattern %return.param_patt, %ptr [concrete]
  712. // CHECK:STDOUT: } {
  713. // CHECK:STDOUT: %i32.loc6_40: type = type_literal constants.%i32 [concrete = constants.%i32]
  714. // CHECK:STDOUT: %ptr: type = ptr_type %i32.loc6_40 [concrete = constants.%ptr.235]
  715. // CHECK:STDOUT: %.loc6: Core.Form = init_form %ptr [concrete = constants.%.605]
  716. // CHECK:STDOUT: %n.param: %i32 = value_param call_param0
  717. // CHECK:STDOUT: %i32.loc6_32: type = type_literal constants.%i32 [concrete = constants.%i32]
  718. // CHECK:STDOUT: %n: %i32 = value_binding n, %n.param
  719. // CHECK:STDOUT: %return.param: ref %ptr.235 = out_param call_param1
  720. // CHECK:STDOUT: %return: ref %ptr.235 = return_slot %return.param
  721. // CHECK:STDOUT: }
  722. // CHECK:STDOUT: }
  723. // CHECK:STDOUT:
  724. // CHECK:STDOUT: generic fn @ImplicitGenericParam(%T.loc4_26.2: type) {
  725. // CHECK:STDOUT: %T.loc4_26.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  726. // CHECK:STDOUT: %pattern_type.loc4_36: type = pattern_type %T.loc4_26.1 [symbolic = %pattern_type.loc4_36 (constants.%pattern_type.51d)]
  727. // CHECK:STDOUT: %ptr.loc4_45.1: type = ptr_type %T.loc4_26.1 [symbolic = %ptr.loc4_45.1 (constants.%ptr.e8f)]
  728. // CHECK:STDOUT: %.loc4_45.1: Core.Form = init_form %ptr.loc4_45.1 [symbolic = %.loc4_45.1 (constants.%.cb6)]
  729. // CHECK:STDOUT: %pattern_type.loc4_45: type = pattern_type %ptr.loc4_45.1 [symbolic = %pattern_type.loc4_45 (constants.%pattern_type.4f4)]
  730. // CHECK:STDOUT:
  731. // CHECK:STDOUT: !definition:
  732. // CHECK:STDOUT: %require_complete.loc4_36: <witness> = require_complete_type %T.loc4_26.1 [symbolic = %require_complete.loc4_36 (constants.%require_complete.944)]
  733. // CHECK:STDOUT: %require_complete.loc4_45: <witness> = require_complete_type %ptr.loc4_45.1 [symbolic = %require_complete.loc4_45 (constants.%require_complete.ef1)]
  734. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2: <specific function> = specific_function constants.%ImplicitGenericParam, @ImplicitGenericParam(%T.loc4_26.1) [symbolic = %ImplicitGenericParam.specific_fn.loc4_56.2 (constants.%ImplicitGenericParam.specific_fn.7cc)]
  735. // CHECK:STDOUT:
  736. // CHECK:STDOUT: fn(%x.param: @ImplicitGenericParam.%T.loc4_26.1 (%T)) -> out %return.param: @ImplicitGenericParam.%ptr.loc4_45.1 (%ptr.e8f) {
  737. // CHECK:STDOUT: !entry:
  738. // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [concrete = constants.%ImplicitGenericParam]
  739. // CHECK:STDOUT: %x.ref: @ImplicitGenericParam.%T.loc4_26.1 (%T) = name_ref x, %x
  740. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.1: <specific function> = specific_function %ImplicitGenericParam.ref, @ImplicitGenericParam(constants.%T) [symbolic = %ImplicitGenericParam.specific_fn.loc4_56.2 (constants.%ImplicitGenericParam.specific_fn.7cc)]
  741. // CHECK:STDOUT: %ImplicitGenericParam.call: init @ImplicitGenericParam.%ptr.loc4_45.1 (%ptr.e8f) = call %ImplicitGenericParam.specific_fn.loc4_56.1(%x.ref)
  742. // CHECK:STDOUT: return %ImplicitGenericParam.call
  743. // CHECK:STDOUT: }
  744. // CHECK:STDOUT: }
  745. // CHECK:STDOUT:
  746. // CHECK:STDOUT: fn @CallImplicitGenericParam(%n.param: %i32) -> out %return.param: %ptr.235 {
  747. // CHECK:STDOUT: !entry:
  748. // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [concrete = constants.%ImplicitGenericParam]
  749. // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
  750. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn: <specific function> = specific_function %ImplicitGenericParam.ref, @ImplicitGenericParam(constants.%i32) [concrete = constants.%ImplicitGenericParam.specific_fn.be5]
  751. // CHECK:STDOUT: %ImplicitGenericParam.call: init %ptr.235 = call %ImplicitGenericParam.specific_fn(%n.ref)
  752. // CHECK:STDOUT: return %ImplicitGenericParam.call
  753. // CHECK:STDOUT: }
  754. // CHECK:STDOUT:
  755. // CHECK:STDOUT: specific @ImplicitGenericParam(constants.%T) {
  756. // CHECK:STDOUT: %T.loc4_26.1 => constants.%T
  757. // CHECK:STDOUT: %pattern_type.loc4_36 => constants.%pattern_type.51d
  758. // CHECK:STDOUT: %ptr.loc4_45.1 => constants.%ptr.e8f
  759. // CHECK:STDOUT: %.loc4_45.1 => constants.%.cb6
  760. // CHECK:STDOUT: %pattern_type.loc4_45 => constants.%pattern_type.4f4
  761. // CHECK:STDOUT:
  762. // CHECK:STDOUT: !definition:
  763. // CHECK:STDOUT: %require_complete.loc4_36 => constants.%require_complete.944
  764. // CHECK:STDOUT: %require_complete.loc4_45 => constants.%require_complete.ef1
  765. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.7cc
  766. // CHECK:STDOUT: }
  767. // CHECK:STDOUT:
  768. // CHECK:STDOUT: specific @ImplicitGenericParam(constants.%i32) {
  769. // CHECK:STDOUT: %T.loc4_26.1 => constants.%i32
  770. // CHECK:STDOUT: %pattern_type.loc4_36 => constants.%pattern_type.7ce
  771. // CHECK:STDOUT: %ptr.loc4_45.1 => constants.%ptr.235
  772. // CHECK:STDOUT: %.loc4_45.1 => constants.%.605
  773. // CHECK:STDOUT: %pattern_type.loc4_45 => constants.%pattern_type.fe8
  774. // CHECK:STDOUT:
  775. // CHECK:STDOUT: !definition:
  776. // CHECK:STDOUT: %require_complete.loc4_36 => constants.%complete_type.f8a
  777. // CHECK:STDOUT: %require_complete.loc4_45 => constants.%complete_type.3d0
  778. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.be5
  779. // CHECK:STDOUT: }
  780. // CHECK:STDOUT:
  781. // CHECK:STDOUT: --- deduce_nested_tuple.carbon
  782. // CHECK:STDOUT:
  783. // CHECK:STDOUT: constants {
  784. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  785. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  786. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  787. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  788. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  789. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  790. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  791. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  792. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  793. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
  794. // CHECK:STDOUT: %tuple.c27: %tuple.type.24b = tuple_value (%T, %i32) [symbolic]
  795. // CHECK:STDOUT: %tuple.type.b01: type = tuple_type (%T, %i32) [symbolic]
  796. // CHECK:STDOUT: %pattern_type.e77: type = pattern_type %tuple.type.b01 [symbolic]
  797. // CHECK:STDOUT: %TupleParam.type: type = fn_type @TupleParam [concrete]
  798. // CHECK:STDOUT: %TupleParam: %TupleParam.type = struct_value () [concrete]
  799. // CHECK:STDOUT: %require_complete.9d8: <witness> = require_complete_type %tuple.type.b01 [symbolic]
  800. // CHECK:STDOUT: %CallTupleParam.type: type = fn_type @CallTupleParam [concrete]
  801. // CHECK:STDOUT: %CallTupleParam: %CallTupleParam.type = struct_value () [concrete]
  802. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  803. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  804. // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
  805. // CHECK:STDOUT: %tuple.ad8: %tuple.type.f94 = tuple_value (%int_1, %int_2.ecc) [concrete]
  806. // CHECK:STDOUT: %tuple.ae9: %tuple.type.24b = tuple_value (Core.IntLiteral, %i32) [concrete]
  807. // CHECK:STDOUT: %tuple.type.4c8: type = tuple_type (Core.IntLiteral, %i32) [concrete]
  808. // CHECK:STDOUT: %pattern_type.6f2: type = pattern_type %tuple.type.4c8 [concrete]
  809. // CHECK:STDOUT: %TupleParam.specific_fn: <specific function> = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [concrete]
  810. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  811. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  812. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  813. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  814. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  815. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  816. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  817. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  818. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  819. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  820. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  821. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  822. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  823. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  824. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  825. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  826. // CHECK:STDOUT: %tuple.c87: %tuple.type.4c8 = tuple_value (%int_1, %int_2.ef8) [concrete]
  827. // CHECK:STDOUT: %complete_type.c49: <witness> = complete_type_witness %tuple.type.4c8 [concrete]
  828. // CHECK:STDOUT: }
  829. // CHECK:STDOUT:
  830. // CHECK:STDOUT: imports {
  831. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  832. // CHECK:STDOUT: .Int = %Core.Int
  833. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  834. // CHECK:STDOUT: import Core//prelude
  835. // CHECK:STDOUT: import Core//prelude/...
  836. // CHECK:STDOUT: }
  837. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  838. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  839. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  840. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  841. // CHECK:STDOUT: }
  842. // CHECK:STDOUT:
  843. // CHECK:STDOUT: file {
  844. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  845. // CHECK:STDOUT: .Core = imports.%Core
  846. // CHECK:STDOUT: .TupleParam = %TupleParam.decl
  847. // CHECK:STDOUT: .CallTupleParam = %CallTupleParam.decl
  848. // CHECK:STDOUT: }
  849. // CHECK:STDOUT: %Core.import = import Core
  850. // CHECK:STDOUT: %TupleParam.decl: %TupleParam.type = fn_decl @TupleParam [concrete = constants.%TupleParam] {
  851. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  852. // CHECK:STDOUT: %x.param_patt: @TupleParam.%pattern_type (%pattern_type.e77) = value_param_pattern [concrete]
  853. // CHECK:STDOUT: %x.patt: @TupleParam.%pattern_type (%pattern_type.e77) = at_binding_pattern x, %x.param_patt [concrete]
  854. // CHECK:STDOUT: } {
  855. // CHECK:STDOUT: %.loc4_19.1: type = splice_block %.loc4_19.2 [concrete = type] {
  856. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  857. // CHECK:STDOUT: %.loc4_19.2: type = type_literal type [concrete = type]
  858. // CHECK:STDOUT: }
  859. // CHECK:STDOUT: %T.loc4_16.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  860. // CHECK:STDOUT: %x.param: @TupleParam.%tuple.type (%tuple.type.b01) = value_param call_param0
  861. // CHECK:STDOUT: %.loc4_42.1: type = splice_block %.loc4_42.3 [symbolic = %tuple.type (constants.%tuple.type.b01)] {
  862. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [symbolic = %T.loc4_16.1 (constants.%T)]
  863. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  864. // CHECK:STDOUT: %.loc4_42.2: %tuple.type.24b = tuple_literal (%T.ref, %i32) [symbolic = %tuple (constants.%tuple.c27)]
  865. // CHECK:STDOUT: %.loc4_42.3: type = converted %.loc4_42.2, constants.%tuple.type.b01 [symbolic = %tuple.type (constants.%tuple.type.b01)]
  866. // CHECK:STDOUT: }
  867. // CHECK:STDOUT: %x: @TupleParam.%tuple.type (%tuple.type.b01) = value_binding x, %x.param
  868. // CHECK:STDOUT: }
  869. // CHECK:STDOUT: %CallTupleParam.decl: %CallTupleParam.type = fn_decl @CallTupleParam [concrete = constants.%CallTupleParam] {} {}
  870. // CHECK:STDOUT: }
  871. // CHECK:STDOUT:
  872. // CHECK:STDOUT: generic fn @TupleParam(%T.loc4_16.2: type) {
  873. // CHECK:STDOUT: %T.loc4_16.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
  874. // CHECK:STDOUT: %tuple: %tuple.type.24b = tuple_value (%T.loc4_16.1, constants.%i32) [symbolic = %tuple (constants.%tuple.c27)]
  875. // CHECK:STDOUT: %tuple.type: type = tuple_type (%T.loc4_16.1, constants.%i32) [symbolic = %tuple.type (constants.%tuple.type.b01)]
  876. // CHECK:STDOUT: %pattern_type: type = pattern_type %tuple.type [symbolic = %pattern_type (constants.%pattern_type.e77)]
  877. // CHECK:STDOUT:
  878. // CHECK:STDOUT: !definition:
  879. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %tuple.type [symbolic = %require_complete (constants.%require_complete.9d8)]
  880. // CHECK:STDOUT:
  881. // CHECK:STDOUT: fn(%x.param: @TupleParam.%tuple.type (%tuple.type.b01)) {
  882. // CHECK:STDOUT: !entry:
  883. // CHECK:STDOUT: return
  884. // CHECK:STDOUT: }
  885. // CHECK:STDOUT: }
  886. // CHECK:STDOUT:
  887. // CHECK:STDOUT: fn @CallTupleParam() {
  888. // CHECK:STDOUT: !entry:
  889. // CHECK:STDOUT: %TupleParam.ref: %TupleParam.type = name_ref TupleParam, file.%TupleParam.decl [concrete = constants.%TupleParam]
  890. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  891. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  892. // CHECK:STDOUT: %.loc7_19.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) [concrete = constants.%tuple.ad8]
  893. // CHECK:STDOUT: %TupleParam.specific_fn: <specific function> = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [concrete = constants.%TupleParam.specific_fn]
  894. // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  895. // CHECK:STDOUT: %bound_method.loc7_19.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  896. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  897. // CHECK:STDOUT: %bound_method.loc7_19.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  898. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc7_19.2(%int_2) [concrete = constants.%int_2.ef8]
  899. // CHECK:STDOUT: %.loc7_19.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8]
  900. // CHECK:STDOUT: %.loc7_19.3: %i32 = converted %int_2, %.loc7_19.2 [concrete = constants.%int_2.ef8]
  901. // CHECK:STDOUT: %tuple: %tuple.type.4c8 = tuple_value (%int_1, %.loc7_19.3) [concrete = constants.%tuple.c87]
  902. // CHECK:STDOUT: %.loc7_19.4: %tuple.type.4c8 = converted %.loc7_19.1, %tuple [concrete = constants.%tuple.c87]
  903. // CHECK:STDOUT: %TupleParam.call: init %empty_tuple.type = call %TupleParam.specific_fn(%.loc7_19.4)
  904. // CHECK:STDOUT: return
  905. // CHECK:STDOUT: }
  906. // CHECK:STDOUT:
  907. // CHECK:STDOUT: specific @TupleParam(constants.%T) {
  908. // CHECK:STDOUT: %T.loc4_16.1 => constants.%T
  909. // CHECK:STDOUT: %tuple => constants.%tuple.c27
  910. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.b01
  911. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.e77
  912. // CHECK:STDOUT: }
  913. // CHECK:STDOUT:
  914. // CHECK:STDOUT: specific @TupleParam(Core.IntLiteral) {
  915. // CHECK:STDOUT: %T.loc4_16.1 => Core.IntLiteral
  916. // CHECK:STDOUT: %tuple => constants.%tuple.ae9
  917. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4c8
  918. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.6f2
  919. // CHECK:STDOUT:
  920. // CHECK:STDOUT: !definition:
  921. // CHECK:STDOUT: %require_complete => constants.%complete_type.c49
  922. // CHECK:STDOUT: }
  923. // CHECK:STDOUT:
  924. // CHECK:STDOUT: --- deduce_nested_struct.carbon
  925. // CHECK:STDOUT:
  926. // CHECK:STDOUT: constants {
  927. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  928. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  929. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  930. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  931. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  932. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  933. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
  934. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  935. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  936. // CHECK:STDOUT: %struct_type.a.b.702: type = struct_type {.a: %T, .b: %i32} [symbolic]
  937. // CHECK:STDOUT: %pattern_type.8a5: type = pattern_type %struct_type.a.b.702 [symbolic]
  938. // CHECK:STDOUT: %StructParam.type: type = fn_type @StructParam [concrete]
  939. // CHECK:STDOUT: %StructParam: %StructParam.type = struct_value () [concrete]
  940. // CHECK:STDOUT: %require_complete.19d: <witness> = require_complete_type %struct_type.a.b.702 [symbolic]
  941. // CHECK:STDOUT: %CallStructParam.type: type = fn_type @CallStructParam [concrete]
  942. // CHECK:STDOUT: %CallStructParam: %CallStructParam.type = struct_value () [concrete]
  943. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
  944. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
  945. // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [concrete]
  946. // CHECK:STDOUT: %struct.4aa: %struct_type.a.b.cfd = struct_value (%int_1, %int_2.ecc) [concrete]
  947. // CHECK:STDOUT: %struct_type.a.b.a13: type = struct_type {.a: Core.IntLiteral, .b: %i32} [concrete]
  948. // CHECK:STDOUT: %pattern_type.cfa: type = pattern_type %struct_type.a.b.a13 [concrete]
  949. // CHECK:STDOUT: %StructParam.specific_fn: <specific function> = specific_function %StructParam, @StructParam(Core.IntLiteral) [concrete]
  950. // CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
  951. // CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
  952. // CHECK:STDOUT: %ImplicitAs.type.e8c: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
  953. // CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
  954. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
  955. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6 = struct_value () [symbolic]
  956. // CHECK:STDOUT: %ImplicitAs.impl_witness.6bc: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.74f, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  957. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
  958. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e0d = struct_value () [concrete]
  959. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.e8c = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.6bc) [concrete]
  960. // CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.b37: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
  961. // CHECK:STDOUT: %.545: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.b37, %ImplicitAs.facet [concrete]
  962. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5 [concrete]
  963. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
  964. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2.ecc, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
  965. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
  966. // CHECK:STDOUT: %struct.e87: %struct_type.a.b.a13 = struct_value (%int_1, %int_2.ef8) [concrete]
  967. // CHECK:STDOUT: %complete_type.a4a: <witness> = complete_type_witness %struct_type.a.b.a13 [concrete]
  968. // CHECK:STDOUT: }
  969. // CHECK:STDOUT:
  970. // CHECK:STDOUT: imports {
  971. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  972. // CHECK:STDOUT: .Int = %Core.Int
  973. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  974. // CHECK:STDOUT: import Core//prelude
  975. // CHECK:STDOUT: import Core//prelude/...
  976. // CHECK:STDOUT: }
  977. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  978. // CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
  979. // CHECK:STDOUT: %Core.import_ref.42d: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.4e6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.3c2)]
  980. // CHECK:STDOUT: %ImplicitAs.impl_witness_table.74f = impl_witness_table (%Core.import_ref.42d), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
  981. // CHECK:STDOUT: }
  982. // CHECK:STDOUT:
  983. // CHECK:STDOUT: file {
  984. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  985. // CHECK:STDOUT: .Core = imports.%Core
  986. // CHECK:STDOUT: .StructParam = %StructParam.decl
  987. // CHECK:STDOUT: .CallStructParam = %CallStructParam.decl
  988. // CHECK:STDOUT: }
  989. // CHECK:STDOUT: %Core.import = import Core
  990. // CHECK:STDOUT: %StructParam.decl: %StructParam.type = fn_decl @StructParam [concrete = constants.%StructParam] {
  991. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  992. // CHECK:STDOUT: %x.param_patt: @StructParam.%pattern_type (%pattern_type.8a5) = value_param_pattern [concrete]
  993. // CHECK:STDOUT: %x.patt: @StructParam.%pattern_type (%pattern_type.8a5) = at_binding_pattern x, %x.param_patt [concrete]
  994. // CHECK:STDOUT: } {
  995. // CHECK:STDOUT: %.loc4_20.1: type = splice_block %.loc4_20.2 [concrete = type] {
  996. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  997. // CHECK:STDOUT: %.loc4_20.2: type = type_literal type [concrete = type]
  998. // CHECK:STDOUT: }
  999. // CHECK:STDOUT: %T.loc4_17.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_17.1 (constants.%T)]
  1000. // CHECK:STDOUT: %x.param: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702) = value_param call_param0
  1001. // CHECK:STDOUT: %.loc4_51: type = splice_block %struct_type.a.b.loc4_51.2 [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)] {
  1002. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_17.2 [symbolic = %T.loc4_17.1 (constants.%T)]
  1003. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  1004. // CHECK:STDOUT: %struct_type.a.b.loc4_51.2: type = struct_type {.a: @StructParam.%T.loc4_17.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)]
  1005. // CHECK:STDOUT: }
  1006. // CHECK:STDOUT: %x: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702) = value_binding x, %x.param
  1007. // CHECK:STDOUT: }
  1008. // CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [concrete = constants.%CallStructParam] {} {}
  1009. // CHECK:STDOUT: }
  1010. // CHECK:STDOUT:
  1011. // CHECK:STDOUT: generic fn @StructParam(%T.loc4_17.2: type) {
  1012. // CHECK:STDOUT: %T.loc4_17.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_17.1 (constants.%T)]
  1013. // CHECK:STDOUT: %struct_type.a.b.loc4_51.1: type = struct_type {.a: @StructParam.%T.loc4_17.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)]
  1014. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.b.loc4_51.1 [symbolic = %pattern_type (constants.%pattern_type.8a5)]
  1015. // CHECK:STDOUT:
  1016. // CHECK:STDOUT: !definition:
  1017. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.a.b.loc4_51.1 [symbolic = %require_complete (constants.%require_complete.19d)]
  1018. // CHECK:STDOUT:
  1019. // CHECK:STDOUT: fn(%x.param: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702)) {
  1020. // CHECK:STDOUT: !entry:
  1021. // CHECK:STDOUT: return
  1022. // CHECK:STDOUT: }
  1023. // CHECK:STDOUT: }
  1024. // CHECK:STDOUT:
  1025. // CHECK:STDOUT: fn @CallStructParam() {
  1026. // CHECK:STDOUT: !entry:
  1027. // CHECK:STDOUT: %StructParam.ref: %StructParam.type = name_ref StructParam, file.%StructParam.decl [concrete = constants.%StructParam]
  1028. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
  1029. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
  1030. // CHECK:STDOUT: %.loc7_30.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2) [concrete = constants.%struct.4aa]
  1031. // CHECK:STDOUT: %StructParam.specific_fn: <specific function> = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [concrete = constants.%StructParam.specific_fn]
  1032. // CHECK:STDOUT: %impl.elem0: %.545 = impl_witness_access constants.%ImplicitAs.impl_witness.6bc, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.0b5]
  1033. // CHECK:STDOUT: %bound_method.loc7_30.1: <bound method> = bound_method %int_2, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
  1034. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
  1035. // CHECK:STDOUT: %bound_method.loc7_30.2: <bound method> = bound_method %int_2, %specific_fn [concrete = constants.%bound_method]
  1036. // CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc7_30.2(%int_2) [concrete = constants.%int_2.ef8]
  1037. // CHECK:STDOUT: %.loc7_30.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_2.ef8]
  1038. // CHECK:STDOUT: %.loc7_30.3: %i32 = converted %int_2, %.loc7_30.2 [concrete = constants.%int_2.ef8]
  1039. // CHECK:STDOUT: %struct: %struct_type.a.b.a13 = struct_value (%int_1, %.loc7_30.3) [concrete = constants.%struct.e87]
  1040. // CHECK:STDOUT: %.loc7_30.4: %struct_type.a.b.a13 = converted %.loc7_30.1, %struct [concrete = constants.%struct.e87]
  1041. // CHECK:STDOUT: %StructParam.call: init %empty_tuple.type = call %StructParam.specific_fn(%.loc7_30.4)
  1042. // CHECK:STDOUT: return
  1043. // CHECK:STDOUT: }
  1044. // CHECK:STDOUT:
  1045. // CHECK:STDOUT: specific @StructParam(constants.%T) {
  1046. // CHECK:STDOUT: %T.loc4_17.1 => constants.%T
  1047. // CHECK:STDOUT: %struct_type.a.b.loc4_51.1 => constants.%struct_type.a.b.702
  1048. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.8a5
  1049. // CHECK:STDOUT: }
  1050. // CHECK:STDOUT:
  1051. // CHECK:STDOUT: specific @StructParam(Core.IntLiteral) {
  1052. // CHECK:STDOUT: %T.loc4_17.1 => Core.IntLiteral
  1053. // CHECK:STDOUT: %struct_type.a.b.loc4_51.1 => constants.%struct_type.a.b.a13
  1054. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.cfa
  1055. // CHECK:STDOUT:
  1056. // CHECK:STDOUT: !definition:
  1057. // CHECK:STDOUT: %require_complete => constants.%complete_type.a4a
  1058. // CHECK:STDOUT: }
  1059. // CHECK:STDOUT:
  1060. // CHECK:STDOUT: --- fail_deduce_bigger_struct.carbon
  1061. // CHECK:STDOUT:
  1062. // CHECK:STDOUT: constants {
  1063. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1064. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1065. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1066. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  1067. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1068. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1069. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1070. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1071. // CHECK:STDOUT: %struct_type.c.d.e: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic]
  1072. // CHECK:STDOUT: %pattern_type.1d5: type = pattern_type %struct_type.c.d.e [symbolic]
  1073. // CHECK:STDOUT: %BigStructParam.type: type = fn_type @BigStructParam [concrete]
  1074. // CHECK:STDOUT: %BigStructParam: %BigStructParam.type = struct_value () [concrete]
  1075. // CHECK:STDOUT: %require_complete.32d: <witness> = require_complete_type %struct_type.c.d.e [symbolic]
  1076. // CHECK:STDOUT: %CallBigStructParam.type: type = fn_type @CallBigStructParam [concrete]
  1077. // CHECK:STDOUT: %CallBigStructParam: %CallBigStructParam.type = struct_value () [concrete]
  1078. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
  1079. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete]
  1080. // CHECK:STDOUT: %struct_type.c.d: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [concrete]
  1081. // CHECK:STDOUT: %struct: %struct_type.c.d = struct_value (%int_3, %int_4) [concrete]
  1082. // CHECK:STDOUT: }
  1083. // CHECK:STDOUT:
  1084. // CHECK:STDOUT: imports {
  1085. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1086. // CHECK:STDOUT: .Int = %Core.Int
  1087. // CHECK:STDOUT: import Core//prelude
  1088. // CHECK:STDOUT: import Core//prelude/...
  1089. // CHECK:STDOUT: }
  1090. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1091. // CHECK:STDOUT: }
  1092. // CHECK:STDOUT:
  1093. // CHECK:STDOUT: file {
  1094. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1095. // CHECK:STDOUT: .Core = imports.%Core
  1096. // CHECK:STDOUT: .BigStructParam = %BigStructParam.decl
  1097. // CHECK:STDOUT: .CallBigStructParam = %CallBigStructParam.decl
  1098. // CHECK:STDOUT: }
  1099. // CHECK:STDOUT: %Core.import = import Core
  1100. // CHECK:STDOUT: %BigStructParam.decl: %BigStructParam.type = fn_decl @BigStructParam [concrete = constants.%BigStructParam] {
  1101. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1102. // CHECK:STDOUT: %x.param_patt: @BigStructParam.%pattern_type (%pattern_type.1d5) = value_param_pattern [concrete]
  1103. // CHECK:STDOUT: %x.patt: @BigStructParam.%pattern_type (%pattern_type.1d5) = at_binding_pattern x, %x.param_patt [concrete]
  1104. // CHECK:STDOUT: } {
  1105. // CHECK:STDOUT: %.loc4_23.1: type = splice_block %.loc4_23.2 [concrete = type] {
  1106. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1107. // CHECK:STDOUT: %.loc4_23.2: type = type_literal type [concrete = type]
  1108. // CHECK:STDOUT: }
  1109. // CHECK:STDOUT: %T.loc4_20.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_20.1 (constants.%T)]
  1110. // CHECK:STDOUT: %x.param: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e) = value_param call_param0
  1111. // CHECK:STDOUT: %.loc4_63: type = splice_block %struct_type.c.d.e.loc4_63.2 [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)] {
  1112. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_20.2 [symbolic = %T.loc4_20.1 (constants.%T)]
  1113. // CHECK:STDOUT: %i32.loc4_51: type = type_literal constants.%i32 [concrete = constants.%i32]
  1114. // CHECK:STDOUT: %i32.loc4_60: type = type_literal constants.%i32 [concrete = constants.%i32]
  1115. // CHECK:STDOUT: %struct_type.c.d.e.loc4_63.2: type = struct_type {.c: @BigStructParam.%T.loc4_20.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)]
  1116. // CHECK:STDOUT: }
  1117. // CHECK:STDOUT: %x: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e) = value_binding x, %x.param
  1118. // CHECK:STDOUT: }
  1119. // CHECK:STDOUT: %CallBigStructParam.decl: %CallBigStructParam.type = fn_decl @CallBigStructParam [concrete = constants.%CallBigStructParam] {} {}
  1120. // CHECK:STDOUT: }
  1121. // CHECK:STDOUT:
  1122. // CHECK:STDOUT: generic fn @BigStructParam(%T.loc4_20.2: type) {
  1123. // CHECK:STDOUT: %T.loc4_20.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_20.1 (constants.%T)]
  1124. // CHECK:STDOUT: %struct_type.c.d.e.loc4_63.1: type = struct_type {.c: @BigStructParam.%T.loc4_20.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)]
  1125. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.c.d.e.loc4_63.1 [symbolic = %pattern_type (constants.%pattern_type.1d5)]
  1126. // CHECK:STDOUT:
  1127. // CHECK:STDOUT: !definition:
  1128. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.c.d.e.loc4_63.1 [symbolic = %require_complete (constants.%require_complete.32d)]
  1129. // CHECK:STDOUT:
  1130. // CHECK:STDOUT: fn(%x.param: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e)) {
  1131. // CHECK:STDOUT: !entry:
  1132. // CHECK:STDOUT: return
  1133. // CHECK:STDOUT: }
  1134. // CHECK:STDOUT: }
  1135. // CHECK:STDOUT:
  1136. // CHECK:STDOUT: fn @CallBigStructParam() {
  1137. // CHECK:STDOUT: !entry:
  1138. // CHECK:STDOUT: %BigStructParam.ref: %BigStructParam.type = name_ref BigStructParam, file.%BigStructParam.decl [concrete = constants.%BigStructParam]
  1139. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
  1140. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4]
  1141. // CHECK:STDOUT: %.loc14: %struct_type.c.d = struct_literal (%int_3, %int_4) [concrete = constants.%struct]
  1142. // CHECK:STDOUT: return
  1143. // CHECK:STDOUT: }
  1144. // CHECK:STDOUT:
  1145. // CHECK:STDOUT: specific @BigStructParam(constants.%T) {
  1146. // CHECK:STDOUT: %T.loc4_20.1 => constants.%T
  1147. // CHECK:STDOUT: %struct_type.c.d.e.loc4_63.1 => constants.%struct_type.c.d.e
  1148. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.1d5
  1149. // CHECK:STDOUT: }
  1150. // CHECK:STDOUT:
  1151. // CHECK:STDOUT: --- fail_deduce_smaller_struct.carbon
  1152. // CHECK:STDOUT:
  1153. // CHECK:STDOUT: constants {
  1154. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1155. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1156. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1157. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  1158. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1159. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1160. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1161. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1162. // CHECK:STDOUT: %struct_type.f.g: type = struct_type {.f: %T, .g: %i32} [symbolic]
  1163. // CHECK:STDOUT: %pattern_type.958: type = pattern_type %struct_type.f.g [symbolic]
  1164. // CHECK:STDOUT: %SmallStructParam.type: type = fn_type @SmallStructParam [concrete]
  1165. // CHECK:STDOUT: %SmallStructParam: %SmallStructParam.type = struct_value () [concrete]
  1166. // CHECK:STDOUT: %require_complete.ed5: <witness> = require_complete_type %struct_type.f.g [symbolic]
  1167. // CHECK:STDOUT: %CallSmallStructParam.type: type = fn_type @CallSmallStructParam [concrete]
  1168. // CHECK:STDOUT: %CallSmallStructParam: %CallSmallStructParam.type = struct_value () [concrete]
  1169. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete]
  1170. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete]
  1171. // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete]
  1172. // CHECK:STDOUT: %struct_type.f.g.h: type = struct_type {.f: Core.IntLiteral, .g: Core.IntLiteral, .h: Core.IntLiteral} [concrete]
  1173. // CHECK:STDOUT: %struct: %struct_type.f.g.h = struct_value (%int_5, %int_6, %int_7) [concrete]
  1174. // CHECK:STDOUT: }
  1175. // CHECK:STDOUT:
  1176. // CHECK:STDOUT: imports {
  1177. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1178. // CHECK:STDOUT: .Int = %Core.Int
  1179. // CHECK:STDOUT: import Core//prelude
  1180. // CHECK:STDOUT: import Core//prelude/...
  1181. // CHECK:STDOUT: }
  1182. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1183. // CHECK:STDOUT: }
  1184. // CHECK:STDOUT:
  1185. // CHECK:STDOUT: file {
  1186. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1187. // CHECK:STDOUT: .Core = imports.%Core
  1188. // CHECK:STDOUT: .SmallStructParam = %SmallStructParam.decl
  1189. // CHECK:STDOUT: .CallSmallStructParam = %CallSmallStructParam.decl
  1190. // CHECK:STDOUT: }
  1191. // CHECK:STDOUT: %Core.import = import Core
  1192. // CHECK:STDOUT: %SmallStructParam.decl: %SmallStructParam.type = fn_decl @SmallStructParam [concrete = constants.%SmallStructParam] {
  1193. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1194. // CHECK:STDOUT: %x.param_patt: @SmallStructParam.%pattern_type (%pattern_type.958) = value_param_pattern [concrete]
  1195. // CHECK:STDOUT: %x.patt: @SmallStructParam.%pattern_type (%pattern_type.958) = at_binding_pattern x, %x.param_patt [concrete]
  1196. // CHECK:STDOUT: } {
  1197. // CHECK:STDOUT: %.loc4_25.1: type = splice_block %.loc4_25.2 [concrete = type] {
  1198. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1199. // CHECK:STDOUT: %.loc4_25.2: type = type_literal type [concrete = type]
  1200. // CHECK:STDOUT: }
  1201. // CHECK:STDOUT: %T.loc4_22.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_22.1 (constants.%T)]
  1202. // CHECK:STDOUT: %x.param: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g) = value_param call_param0
  1203. // CHECK:STDOUT: %.loc4_56: type = splice_block %struct_type.f.g.loc4_56.2 [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)] {
  1204. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_22.2 [symbolic = %T.loc4_22.1 (constants.%T)]
  1205. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  1206. // CHECK:STDOUT: %struct_type.f.g.loc4_56.2: type = struct_type {.f: @SmallStructParam.%T.loc4_22.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)]
  1207. // CHECK:STDOUT: }
  1208. // CHECK:STDOUT: %x: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g) = value_binding x, %x.param
  1209. // CHECK:STDOUT: }
  1210. // CHECK:STDOUT: %CallSmallStructParam.decl: %CallSmallStructParam.type = fn_decl @CallSmallStructParam [concrete = constants.%CallSmallStructParam] {} {}
  1211. // CHECK:STDOUT: }
  1212. // CHECK:STDOUT:
  1213. // CHECK:STDOUT: generic fn @SmallStructParam(%T.loc4_22.2: type) {
  1214. // CHECK:STDOUT: %T.loc4_22.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_22.1 (constants.%T)]
  1215. // CHECK:STDOUT: %struct_type.f.g.loc4_56.1: type = struct_type {.f: @SmallStructParam.%T.loc4_22.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)]
  1216. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.f.g.loc4_56.1 [symbolic = %pattern_type (constants.%pattern_type.958)]
  1217. // CHECK:STDOUT:
  1218. // CHECK:STDOUT: !definition:
  1219. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.f.g.loc4_56.1 [symbolic = %require_complete (constants.%require_complete.ed5)]
  1220. // CHECK:STDOUT:
  1221. // CHECK:STDOUT: fn(%x.param: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g)) {
  1222. // CHECK:STDOUT: !entry:
  1223. // CHECK:STDOUT: return
  1224. // CHECK:STDOUT: }
  1225. // CHECK:STDOUT: }
  1226. // CHECK:STDOUT:
  1227. // CHECK:STDOUT: fn @CallSmallStructParam() {
  1228. // CHECK:STDOUT: !entry:
  1229. // CHECK:STDOUT: %SmallStructParam.ref: %SmallStructParam.type = name_ref SmallStructParam, file.%SmallStructParam.decl [concrete = constants.%SmallStructParam]
  1230. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5]
  1231. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6]
  1232. // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7]
  1233. // CHECK:STDOUT: %.loc14: %struct_type.f.g.h = struct_literal (%int_5, %int_6, %int_7) [concrete = constants.%struct]
  1234. // CHECK:STDOUT: return
  1235. // CHECK:STDOUT: }
  1236. // CHECK:STDOUT:
  1237. // CHECK:STDOUT: specific @SmallStructParam(constants.%T) {
  1238. // CHECK:STDOUT: %T.loc4_22.1 => constants.%T
  1239. // CHECK:STDOUT: %struct_type.f.g.loc4_56.1 => constants.%struct_type.f.g
  1240. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.958
  1241. // CHECK:STDOUT: }
  1242. // CHECK:STDOUT:
  1243. // CHECK:STDOUT: --- fail_deduce_struct_wrong_name.carbon
  1244. // CHECK:STDOUT:
  1245. // CHECK:STDOUT: constants {
  1246. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1247. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1248. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1249. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  1250. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1251. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1252. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1253. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1254. // CHECK:STDOUT: %struct_type.i.different: type = struct_type {.i: %T, .different: %i32} [symbolic]
  1255. // CHECK:STDOUT: %pattern_type.ce4: type = pattern_type %struct_type.i.different [symbolic]
  1256. // CHECK:STDOUT: %WrongNameStructParam.type: type = fn_type @WrongNameStructParam [concrete]
  1257. // CHECK:STDOUT: %WrongNameStructParam: %WrongNameStructParam.type = struct_value () [concrete]
  1258. // CHECK:STDOUT: %require_complete.c84: <witness> = require_complete_type %struct_type.i.different [symbolic]
  1259. // CHECK:STDOUT: %CallWrongNameStructParam.type: type = fn_type @CallWrongNameStructParam [concrete]
  1260. // CHECK:STDOUT: %CallWrongNameStructParam: %CallWrongNameStructParam.type = struct_value () [concrete]
  1261. // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete]
  1262. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete]
  1263. // CHECK:STDOUT: %struct_type.i.j: type = struct_type {.i: Core.IntLiteral, .j: Core.IntLiteral} [concrete]
  1264. // CHECK:STDOUT: %struct: %struct_type.i.j = struct_value (%int_8, %int_9) [concrete]
  1265. // CHECK:STDOUT: }
  1266. // CHECK:STDOUT:
  1267. // CHECK:STDOUT: imports {
  1268. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1269. // CHECK:STDOUT: .Int = %Core.Int
  1270. // CHECK:STDOUT: import Core//prelude
  1271. // CHECK:STDOUT: import Core//prelude/...
  1272. // CHECK:STDOUT: }
  1273. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1274. // CHECK:STDOUT: }
  1275. // CHECK:STDOUT:
  1276. // CHECK:STDOUT: file {
  1277. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1278. // CHECK:STDOUT: .Core = imports.%Core
  1279. // CHECK:STDOUT: .WrongNameStructParam = %WrongNameStructParam.decl
  1280. // CHECK:STDOUT: .CallWrongNameStructParam = %CallWrongNameStructParam.decl
  1281. // CHECK:STDOUT: }
  1282. // CHECK:STDOUT: %Core.import = import Core
  1283. // CHECK:STDOUT: %WrongNameStructParam.decl: %WrongNameStructParam.type = fn_decl @WrongNameStructParam [concrete = constants.%WrongNameStructParam] {
  1284. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1285. // CHECK:STDOUT: %x.param_patt: @WrongNameStructParam.%pattern_type (%pattern_type.ce4) = value_param_pattern [concrete]
  1286. // CHECK:STDOUT: %x.patt: @WrongNameStructParam.%pattern_type (%pattern_type.ce4) = at_binding_pattern x, %x.param_patt [concrete]
  1287. // CHECK:STDOUT: } {
  1288. // CHECK:STDOUT: %.loc4_29.1: type = splice_block %.loc4_29.2 [concrete = type] {
  1289. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1290. // CHECK:STDOUT: %.loc4_29.2: type = type_literal type [concrete = type]
  1291. // CHECK:STDOUT: }
  1292. // CHECK:STDOUT: %T.loc4_26.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  1293. // CHECK:STDOUT: %x.param: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different) = value_param call_param0
  1294. // CHECK:STDOUT: %.loc4_68: type = splice_block %struct_type.i.different.loc4_68.2 [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)] {
  1295. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  1296. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  1297. // CHECK:STDOUT: %struct_type.i.different.loc4_68.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_26.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)]
  1298. // CHECK:STDOUT: }
  1299. // CHECK:STDOUT: %x: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different) = value_binding x, %x.param
  1300. // CHECK:STDOUT: }
  1301. // CHECK:STDOUT: %CallWrongNameStructParam.decl: %CallWrongNameStructParam.type = fn_decl @CallWrongNameStructParam [concrete = constants.%CallWrongNameStructParam] {} {}
  1302. // CHECK:STDOUT: }
  1303. // CHECK:STDOUT:
  1304. // CHECK:STDOUT: generic fn @WrongNameStructParam(%T.loc4_26.2: type) {
  1305. // CHECK:STDOUT: %T.loc4_26.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  1306. // CHECK:STDOUT: %struct_type.i.different.loc4_68.1: type = struct_type {.i: @WrongNameStructParam.%T.loc4_26.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)]
  1307. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.i.different.loc4_68.1 [symbolic = %pattern_type (constants.%pattern_type.ce4)]
  1308. // CHECK:STDOUT:
  1309. // CHECK:STDOUT: !definition:
  1310. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.i.different.loc4_68.1 [symbolic = %require_complete (constants.%require_complete.c84)]
  1311. // CHECK:STDOUT:
  1312. // CHECK:STDOUT: fn(%x.param: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different)) {
  1313. // CHECK:STDOUT: !entry:
  1314. // CHECK:STDOUT: return
  1315. // CHECK:STDOUT: }
  1316. // CHECK:STDOUT: }
  1317. // CHECK:STDOUT:
  1318. // CHECK:STDOUT: fn @CallWrongNameStructParam() {
  1319. // CHECK:STDOUT: !entry:
  1320. // CHECK:STDOUT: %WrongNameStructParam.ref: %WrongNameStructParam.type = name_ref WrongNameStructParam, file.%WrongNameStructParam.decl [concrete = constants.%WrongNameStructParam]
  1321. // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8]
  1322. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9]
  1323. // CHECK:STDOUT: %.loc14: %struct_type.i.j = struct_literal (%int_8, %int_9) [concrete = constants.%struct]
  1324. // CHECK:STDOUT: return
  1325. // CHECK:STDOUT: }
  1326. // CHECK:STDOUT:
  1327. // CHECK:STDOUT: specific @WrongNameStructParam(constants.%T) {
  1328. // CHECK:STDOUT: %T.loc4_26.1 => constants.%T
  1329. // CHECK:STDOUT: %struct_type.i.different.loc4_68.1 => constants.%struct_type.i.different
  1330. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ce4
  1331. // CHECK:STDOUT: }
  1332. // CHECK:STDOUT:
  1333. // CHECK:STDOUT: --- fail_todo_deduce_struct_wrong_order.carbon
  1334. // CHECK:STDOUT:
  1335. // CHECK:STDOUT: constants {
  1336. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1337. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1338. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1339. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  1340. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
  1341. // CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
  1342. // CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
  1343. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
  1344. // CHECK:STDOUT: %struct_type.first.second: type = struct_type {.first: %T, .second: %i32} [symbolic]
  1345. // CHECK:STDOUT: %pattern_type.ab3: type = pattern_type %struct_type.first.second [symbolic]
  1346. // CHECK:STDOUT: %WrongOrderStructParam.type: type = fn_type @WrongOrderStructParam [concrete]
  1347. // CHECK:STDOUT: %WrongOrderStructParam: %WrongOrderStructParam.type = struct_value () [concrete]
  1348. // CHECK:STDOUT: %require_complete.311: <witness> = require_complete_type %struct_type.first.second [symbolic]
  1349. // CHECK:STDOUT: %CallWrongOrderStructParam.type: type = fn_type @CallWrongOrderStructParam [concrete]
  1350. // CHECK:STDOUT: %CallWrongOrderStructParam: %CallWrongOrderStructParam.type = struct_value () [concrete]
  1351. // CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [concrete]
  1352. // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete]
  1353. // CHECK:STDOUT: %struct_type.second.first: type = struct_type {.second: Core.IntLiteral, .first: Core.IntLiteral} [concrete]
  1354. // CHECK:STDOUT: %struct: %struct_type.second.first = struct_value (%int_11, %int_10) [concrete]
  1355. // CHECK:STDOUT: }
  1356. // CHECK:STDOUT:
  1357. // CHECK:STDOUT: imports {
  1358. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1359. // CHECK:STDOUT: .Int = %Core.Int
  1360. // CHECK:STDOUT: import Core//prelude
  1361. // CHECK:STDOUT: import Core//prelude/...
  1362. // CHECK:STDOUT: }
  1363. // CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
  1364. // CHECK:STDOUT: }
  1365. // CHECK:STDOUT:
  1366. // CHECK:STDOUT: file {
  1367. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1368. // CHECK:STDOUT: .Core = imports.%Core
  1369. // CHECK:STDOUT: .WrongOrderStructParam = %WrongOrderStructParam.decl
  1370. // CHECK:STDOUT: .CallWrongOrderStructParam = %CallWrongOrderStructParam.decl
  1371. // CHECK:STDOUT: }
  1372. // CHECK:STDOUT: %Core.import = import Core
  1373. // CHECK:STDOUT: %WrongOrderStructParam.decl: %WrongOrderStructParam.type = fn_decl @WrongOrderStructParam [concrete = constants.%WrongOrderStructParam] {
  1374. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1375. // CHECK:STDOUT: %x.param_patt: @WrongOrderStructParam.%pattern_type (%pattern_type.ab3) = value_param_pattern [concrete]
  1376. // CHECK:STDOUT: %x.patt: @WrongOrderStructParam.%pattern_type (%pattern_type.ab3) = at_binding_pattern x, %x.param_patt [concrete]
  1377. // CHECK:STDOUT: } {
  1378. // CHECK:STDOUT: %.loc4_30.1: type = splice_block %.loc4_30.2 [concrete = type] {
  1379. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1380. // CHECK:STDOUT: %.loc4_30.2: type = type_literal type [concrete = type]
  1381. // CHECK:STDOUT: }
  1382. // CHECK:STDOUT: %T.loc4_27.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_27.1 (constants.%T)]
  1383. // CHECK:STDOUT: %x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second) = value_param call_param0
  1384. // CHECK:STDOUT: %.loc4_70: type = splice_block %struct_type.first.second.loc4_70.2 [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)] {
  1385. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_27.2 [symbolic = %T.loc4_27.1 (constants.%T)]
  1386. // CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
  1387. // CHECK:STDOUT: %struct_type.first.second.loc4_70.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_27.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)]
  1388. // CHECK:STDOUT: }
  1389. // CHECK:STDOUT: %x: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second) = value_binding x, %x.param
  1390. // CHECK:STDOUT: }
  1391. // CHECK:STDOUT: %CallWrongOrderStructParam.decl: %CallWrongOrderStructParam.type = fn_decl @CallWrongOrderStructParam [concrete = constants.%CallWrongOrderStructParam] {} {}
  1392. // CHECK:STDOUT: }
  1393. // CHECK:STDOUT:
  1394. // CHECK:STDOUT: generic fn @WrongOrderStructParam(%T.loc4_27.2: type) {
  1395. // CHECK:STDOUT: %T.loc4_27.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_27.1 (constants.%T)]
  1396. // CHECK:STDOUT: %struct_type.first.second.loc4_70.1: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_27.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)]
  1397. // CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.first.second.loc4_70.1 [symbolic = %pattern_type (constants.%pattern_type.ab3)]
  1398. // CHECK:STDOUT:
  1399. // CHECK:STDOUT: !definition:
  1400. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.first.second.loc4_70.1 [symbolic = %require_complete (constants.%require_complete.311)]
  1401. // CHECK:STDOUT:
  1402. // CHECK:STDOUT: fn(%x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second)) {
  1403. // CHECK:STDOUT: !entry:
  1404. // CHECK:STDOUT: return
  1405. // CHECK:STDOUT: }
  1406. // CHECK:STDOUT: }
  1407. // CHECK:STDOUT:
  1408. // CHECK:STDOUT: fn @CallWrongOrderStructParam() {
  1409. // CHECK:STDOUT: !entry:
  1410. // CHECK:STDOUT: %WrongOrderStructParam.ref: %WrongOrderStructParam.type = name_ref WrongOrderStructParam, file.%WrongOrderStructParam.decl [concrete = constants.%WrongOrderStructParam]
  1411. // CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [concrete = constants.%int_11]
  1412. // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete = constants.%int_10]
  1413. // CHECK:STDOUT: %.loc14: %struct_type.second.first = struct_literal (%int_11, %int_10) [concrete = constants.%struct]
  1414. // CHECK:STDOUT: return
  1415. // CHECK:STDOUT: }
  1416. // CHECK:STDOUT:
  1417. // CHECK:STDOUT: specific @WrongOrderStructParam(constants.%T) {
  1418. // CHECK:STDOUT: %T.loc4_27.1 => constants.%T
  1419. // CHECK:STDOUT: %struct_type.first.second.loc4_70.1 => constants.%struct_type.first.second
  1420. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.ab3
  1421. // CHECK:STDOUT: }
  1422. // CHECK:STDOUT:
  1423. // CHECK:STDOUT: --- fail_deduce_incomplete.carbon
  1424. // CHECK:STDOUT:
  1425. // CHECK:STDOUT: constants {
  1426. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1427. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1428. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1429. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  1430. // CHECK:STDOUT: %U: type = symbolic_binding U, 1 [symbolic]
  1431. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
  1432. // CHECK:STDOUT: %.822: Core.Form = init_form %U [symbolic]
  1433. // CHECK:STDOUT: %pattern_type.946: type = pattern_type %U [symbolic]
  1434. // CHECK:STDOUT: %ImplicitNotDeducible.type: type = fn_type @ImplicitNotDeducible [concrete]
  1435. // CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [concrete]
  1436. // CHECK:STDOUT: %CallImplicitNotDeducible.type: type = fn_type @CallImplicitNotDeducible [concrete]
  1437. // CHECK:STDOUT: %CallImplicitNotDeducible: %CallImplicitNotDeducible.type = struct_value () [concrete]
  1438. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete]
  1439. // CHECK:STDOUT: }
  1440. // CHECK:STDOUT:
  1441. // CHECK:STDOUT: imports {
  1442. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1443. // CHECK:STDOUT: import Core//prelude
  1444. // CHECK:STDOUT: import Core//prelude/...
  1445. // CHECK:STDOUT: }
  1446. // CHECK:STDOUT: }
  1447. // CHECK:STDOUT:
  1448. // CHECK:STDOUT: file {
  1449. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1450. // CHECK:STDOUT: .Core = imports.%Core
  1451. // CHECK:STDOUT: .ImplicitNotDeducible = %ImplicitNotDeducible.decl
  1452. // CHECK:STDOUT: .CallImplicitNotDeducible = %CallImplicitNotDeducible.decl
  1453. // CHECK:STDOUT: }
  1454. // CHECK:STDOUT: %Core.import = import Core
  1455. // CHECK:STDOUT: %ImplicitNotDeducible.decl: %ImplicitNotDeducible.type = fn_decl @ImplicitNotDeducible [concrete = constants.%ImplicitNotDeducible] {
  1456. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1457. // CHECK:STDOUT: %U.patt: %pattern_type.98f = symbolic_binding_pattern U, 1 [concrete]
  1458. // CHECK:STDOUT: %x.param_patt: @ImplicitNotDeducible.%pattern_type.loc6_46 (%pattern_type.51d) = value_param_pattern [concrete]
  1459. // CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%pattern_type.loc6_46 (%pattern_type.51d) = at_binding_pattern x, %x.param_patt [concrete]
  1460. // CHECK:STDOUT: %return.param_patt: @ImplicitNotDeducible.%pattern_type.loc6_54 (%pattern_type.946) = out_param_pattern [concrete]
  1461. // CHECK:STDOUT: %return.patt: @ImplicitNotDeducible.%pattern_type.loc6_54 (%pattern_type.946) = return_slot_pattern %return.param_patt, %U.ref [concrete]
  1462. // CHECK:STDOUT: } {
  1463. // CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc6_36.2 [symbolic = %U.loc6_36.1 (constants.%U)]
  1464. // CHECK:STDOUT: %.loc6_54.2: Core.Form = init_form %U.ref [symbolic = %.loc6_54.1 (constants.%.822)]
  1465. // CHECK:STDOUT: %.loc6_29.1: type = splice_block %.loc6_29.2 [concrete = type] {
  1466. // CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1467. // CHECK:STDOUT: %.loc6_29.2: type = type_literal type [concrete = type]
  1468. // CHECK:STDOUT: }
  1469. // CHECK:STDOUT: %T.loc6_26.2: type = symbolic_binding T, 0 [symbolic = %T.loc6_26.1 (constants.%T)]
  1470. // CHECK:STDOUT: %.loc6_39.1: type = splice_block %.loc6_39.2 [concrete = type] {
  1471. // CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1472. // CHECK:STDOUT: %.loc6_39.2: type = type_literal type [concrete = type]
  1473. // CHECK:STDOUT: }
  1474. // CHECK:STDOUT: %U.loc6_36.2: type = symbolic_binding U, 1 [symbolic = %U.loc6_36.1 (constants.%U)]
  1475. // CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc6_26.1 (%T) = value_param call_param0
  1476. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_26.2 [symbolic = %T.loc6_26.1 (constants.%T)]
  1477. // CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc6_26.1 (%T) = value_binding x, %x.param
  1478. // CHECK:STDOUT: %return.param: ref @ImplicitNotDeducible.%U.loc6_36.1 (%U) = out_param call_param1
  1479. // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%U.loc6_36.1 (%U) = return_slot %return.param
  1480. // CHECK:STDOUT: }
  1481. // CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [concrete = constants.%CallImplicitNotDeducible] {} {}
  1482. // CHECK:STDOUT: }
  1483. // CHECK:STDOUT:
  1484. // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc6_26.2: type, %U.loc6_36.2: type) {
  1485. // CHECK:STDOUT: %T.loc6_26.1: type = symbolic_binding T, 0 [symbolic = %T.loc6_26.1 (constants.%T)]
  1486. // CHECK:STDOUT: %U.loc6_36.1: type = symbolic_binding U, 1 [symbolic = %U.loc6_36.1 (constants.%U)]
  1487. // CHECK:STDOUT: %pattern_type.loc6_46: type = pattern_type %T.loc6_26.1 [symbolic = %pattern_type.loc6_46 (constants.%pattern_type.51d)]
  1488. // CHECK:STDOUT: %.loc6_54.1: Core.Form = init_form %U.loc6_36.1 [symbolic = %.loc6_54.1 (constants.%.822)]
  1489. // CHECK:STDOUT: %pattern_type.loc6_54: type = pattern_type %U.loc6_36.1 [symbolic = %pattern_type.loc6_54 (constants.%pattern_type.946)]
  1490. // CHECK:STDOUT:
  1491. // CHECK:STDOUT: fn(%x.param: @ImplicitNotDeducible.%T.loc6_26.1 (%T)) -> out %return.param: @ImplicitNotDeducible.%U.loc6_36.1 (%U);
  1492. // CHECK:STDOUT: }
  1493. // CHECK:STDOUT:
  1494. // CHECK:STDOUT: fn @CallImplicitNotDeducible() {
  1495. // CHECK:STDOUT: !entry:
  1496. // CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [concrete = constants.%ImplicitNotDeducible]
  1497. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42]
  1498. // CHECK:STDOUT: return
  1499. // CHECK:STDOUT: }
  1500. // CHECK:STDOUT:
  1501. // CHECK:STDOUT: specific @ImplicitNotDeducible(constants.%T, constants.%U) {
  1502. // CHECK:STDOUT: %T.loc6_26.1 => constants.%T
  1503. // CHECK:STDOUT: %U.loc6_36.1 => constants.%U
  1504. // CHECK:STDOUT: %pattern_type.loc6_46 => constants.%pattern_type.51d
  1505. // CHECK:STDOUT: %.loc6_54.1 => constants.%.822
  1506. // CHECK:STDOUT: %pattern_type.loc6_54 => constants.%pattern_type.946
  1507. // CHECK:STDOUT: }
  1508. // CHECK:STDOUT:
  1509. // CHECK:STDOUT: --- fail_deduce_inconsistent.carbon
  1510. // CHECK:STDOUT:
  1511. // CHECK:STDOUT: constants {
  1512. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1513. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1514. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1515. // CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
  1516. // CHECK:STDOUT: %pattern_type.51d: type = pattern_type %T [symbolic]
  1517. // CHECK:STDOUT: %.184: Core.Form = init_form %T [symbolic]
  1518. // CHECK:STDOUT: %ImplicitNotDeducible.type: type = fn_type @ImplicitNotDeducible [concrete]
  1519. // CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [concrete]
  1520. // CHECK:STDOUT: %CallImplicitNotDeducible.type: type = fn_type @CallImplicitNotDeducible [concrete]
  1521. // CHECK:STDOUT: %CallImplicitNotDeducible: %CallImplicitNotDeducible.type = struct_value () [concrete]
  1522. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete]
  1523. // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete]
  1524. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: Core.IntLiteral} [concrete]
  1525. // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%int_12) [concrete]
  1526. // CHECK:STDOUT: }
  1527. // CHECK:STDOUT:
  1528. // CHECK:STDOUT: imports {
  1529. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1530. // CHECK:STDOUT: import Core//prelude
  1531. // CHECK:STDOUT: import Core//prelude/...
  1532. // CHECK:STDOUT: }
  1533. // CHECK:STDOUT: }
  1534. // CHECK:STDOUT:
  1535. // CHECK:STDOUT: file {
  1536. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1537. // CHECK:STDOUT: .Core = imports.%Core
  1538. // CHECK:STDOUT: .ImplicitNotDeducible = %ImplicitNotDeducible.decl
  1539. // CHECK:STDOUT: .CallImplicitNotDeducible = %CallImplicitNotDeducible.decl
  1540. // CHECK:STDOUT: }
  1541. // CHECK:STDOUT: %Core.import = import Core
  1542. // CHECK:STDOUT: %ImplicitNotDeducible.decl: %ImplicitNotDeducible.type = fn_decl @ImplicitNotDeducible [concrete = constants.%ImplicitNotDeducible] {
  1543. // CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
  1544. // CHECK:STDOUT: %x.param_patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.51d) = value_param_pattern [concrete]
  1545. // CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.51d) = at_binding_pattern x, %x.param_patt [concrete]
  1546. // CHECK:STDOUT: %y.param_patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.51d) = value_param_pattern [concrete]
  1547. // CHECK:STDOUT: %y.patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.51d) = at_binding_pattern y, %y.param_patt [concrete]
  1548. // CHECK:STDOUT: %return.param_patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.51d) = out_param_pattern [concrete]
  1549. // CHECK:STDOUT: %return.patt: @ImplicitNotDeducible.%pattern_type (%pattern_type.51d) = return_slot_pattern %return.param_patt, %T.ref.loc4_50 [concrete]
  1550. // CHECK:STDOUT: } {
  1551. // CHECK:STDOUT: %T.ref.loc4_50: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  1552. // CHECK:STDOUT: %.loc4_50.2: Core.Form = init_form %T.ref.loc4_50 [symbolic = %.loc4_50.1 (constants.%.184)]
  1553. // CHECK:STDOUT: %.loc4_29.1: type = splice_block %.loc4_29.2 [concrete = type] {
  1554. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1555. // CHECK:STDOUT: %.loc4_29.2: type = type_literal type [concrete = type]
  1556. // CHECK:STDOUT: }
  1557. // CHECK:STDOUT: %T.loc4_26.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  1558. // CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc4_26.1 (%T) = value_param call_param0
  1559. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  1560. // CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc4_26.1 (%T) = value_binding x, %x.param
  1561. // CHECK:STDOUT: %y.param: @ImplicitNotDeducible.%T.loc4_26.1 (%T) = value_param call_param1
  1562. // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
  1563. // CHECK:STDOUT: %y: @ImplicitNotDeducible.%T.loc4_26.1 (%T) = value_binding y, %y.param
  1564. // CHECK:STDOUT: %return.param: ref @ImplicitNotDeducible.%T.loc4_26.1 (%T) = out_param call_param2
  1565. // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%T.loc4_26.1 (%T) = return_slot %return.param
  1566. // CHECK:STDOUT: }
  1567. // CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [concrete = constants.%CallImplicitNotDeducible] {} {}
  1568. // CHECK:STDOUT: }
  1569. // CHECK:STDOUT:
  1570. // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc4_26.2: type) {
  1571. // CHECK:STDOUT: %T.loc4_26.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
  1572. // CHECK:STDOUT: %pattern_type: type = pattern_type %T.loc4_26.1 [symbolic = %pattern_type (constants.%pattern_type.51d)]
  1573. // CHECK:STDOUT: %.loc4_50.1: Core.Form = init_form %T.loc4_26.1 [symbolic = %.loc4_50.1 (constants.%.184)]
  1574. // CHECK:STDOUT:
  1575. // CHECK:STDOUT: fn(%x.param: @ImplicitNotDeducible.%T.loc4_26.1 (%T), %y.param: @ImplicitNotDeducible.%T.loc4_26.1 (%T)) -> out %return.param: @ImplicitNotDeducible.%T.loc4_26.1 (%T);
  1576. // CHECK:STDOUT: }
  1577. // CHECK:STDOUT:
  1578. // CHECK:STDOUT: fn @CallImplicitNotDeducible() {
  1579. // CHECK:STDOUT: !entry:
  1580. // CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [concrete = constants.%ImplicitNotDeducible]
  1581. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42]
  1582. // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12]
  1583. // CHECK:STDOUT: %.loc14: %struct_type.x = struct_literal (%int_12) [concrete = constants.%struct]
  1584. // CHECK:STDOUT: return
  1585. // CHECK:STDOUT: }
  1586. // CHECK:STDOUT:
  1587. // CHECK:STDOUT: specific @ImplicitNotDeducible(constants.%T) {
  1588. // CHECK:STDOUT: %T.loc4_26.1 => constants.%T
  1589. // CHECK:STDOUT: %pattern_type => constants.%pattern_type.51d
  1590. // CHECK:STDOUT: %.loc4_50.1 => constants.%.184
  1591. // CHECK:STDOUT: }
  1592. // CHECK:STDOUT:
  1593. // CHECK:STDOUT: --- deduce_nested_generic_class.carbon
  1594. // CHECK:STDOUT:
  1595. // CHECK:STDOUT: constants {
  1596. // CHECK:STDOUT: %Z.type: type = facet_type <@Z> [concrete]
  1597. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic]
  1598. // CHECK:STDOUT: %EE: type = class_type @EE [concrete]
  1599. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  1600. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  1601. // CHECK:STDOUT: %Z.impl_witness.c05: <witness> = impl_witness @EE.as.Z.impl.%Z.impl_witness_table [concrete]
  1602. // CHECK:STDOUT: %Z.facet.5dc: %Z.type = facet_value %EE, (%Z.impl_witness.c05) [concrete]
  1603. // CHECK:STDOUT: %type: type = facet_type <type> [concrete]
  1604. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
  1605. // CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
  1606. // CHECK:STDOUT: %E: type = symbolic_binding E, 0 [symbolic]
  1607. // CHECK:STDOUT: %DD.type: type = generic_class_type @DD [concrete]
  1608. // CHECK:STDOUT: %DD.generic: %DD.type = struct_value () [concrete]
  1609. // CHECK:STDOUT: %DD.a29: type = class_type @DD, @DD(%E) [symbolic]
  1610. // CHECK:STDOUT: %Z.impl_witness.437: <witness> = impl_witness @DD.as.Z.impl.%Z.impl_witness_table, @DD.as.Z.impl(%E) [symbolic]
  1611. // CHECK:STDOUT: %Z.facet.dc0: %Z.type = facet_value %DD.a29, (%Z.impl_witness.437) [symbolic]
  1612. // CHECK:STDOUT: %pattern_type.22b: type = pattern_type %Z.type [concrete]
  1613. // CHECK:STDOUT: %D: %Z.type = symbolic_binding D, 0 [symbolic]
  1614. // CHECK:STDOUT: %CC.type: type = generic_class_type @CC [concrete]
  1615. // CHECK:STDOUT: %CC.generic: %CC.type = struct_value () [concrete]
  1616. // CHECK:STDOUT: %CC.a1b: type = class_type @CC, @CC(%D) [symbolic]
  1617. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %DD.a29, @Z [symbolic]
  1618. // CHECK:STDOUT: %.bf4: require_specific_def_type = require_specific_def @DD.as.Z.impl(%E) [symbolic]
  1619. // CHECK:STDOUT: %Z.facet.892: %Z.type = facet_value %DD.a29, (%Z.lookup_impl_witness) [symbolic]
  1620. // CHECK:STDOUT: %CC.4e1: type = class_type @CC, @CC(%Z.facet.892) [symbolic]
  1621. // CHECK:STDOUT: %Z.impl_witness.40e: <witness> = impl_witness @CC.as.Z.impl.%Z.impl_witness_table, @CC.as.Z.impl(%E) [symbolic]
  1622. // CHECK:STDOUT: %Z.facet.b7b: %Z.type = facet_value %CC.4e1, (%Z.impl_witness.40e) [symbolic]
  1623. // CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
  1624. // CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
  1625. // CHECK:STDOUT: %DD.2e1: type = class_type @DD, @DD(%EE) [concrete]
  1626. // CHECK:STDOUT: %Z.impl_witness.8a3: <witness> = impl_witness @DD.as.Z.impl.%Z.impl_witness_table, @DD.as.Z.impl(%EE) [concrete]
  1627. // CHECK:STDOUT: %.36d: require_specific_def_type = require_specific_def @DD.as.Z.impl(%EE) [concrete]
  1628. // CHECK:STDOUT: %Z.facet.74c: %Z.type = facet_value %DD.2e1, (%Z.impl_witness.8a3) [concrete]
  1629. // CHECK:STDOUT: %CC.b19: type = class_type @CC, @CC(%Z.facet.74c) [concrete]
  1630. // CHECK:STDOUT: %Z.impl_witness.cb4: <witness> = impl_witness @CC.as.Z.impl.%Z.impl_witness_table, @CC.as.Z.impl(%EE) [concrete]
  1631. // CHECK:STDOUT: %Z.facet.145: %Z.type = facet_value %CC.b19, (%Z.impl_witness.cb4) [concrete]
  1632. // CHECK:STDOUT: }
  1633. // CHECK:STDOUT:
  1634. // CHECK:STDOUT: imports {
  1635. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
  1636. // CHECK:STDOUT: import Core//prelude
  1637. // CHECK:STDOUT: import Core//prelude/...
  1638. // CHECK:STDOUT: }
  1639. // CHECK:STDOUT: }
  1640. // CHECK:STDOUT:
  1641. // CHECK:STDOUT: file {
  1642. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  1643. // CHECK:STDOUT: .Core = imports.%Core
  1644. // CHECK:STDOUT: .Z = %Z.decl
  1645. // CHECK:STDOUT: .EE = %EE.decl
  1646. // CHECK:STDOUT: .DD = %DD.decl
  1647. // CHECK:STDOUT: .CC = %CC.decl
  1648. // CHECK:STDOUT: .F = %F.decl
  1649. // CHECK:STDOUT: }
  1650. // CHECK:STDOUT: %Core.import = import Core
  1651. // CHECK:STDOUT: %Z.decl: type = interface_decl @Z [concrete = constants.%Z.type] {} {}
  1652. // CHECK:STDOUT: %EE.decl: type = class_decl @EE [concrete = constants.%EE] {} {}
  1653. // CHECK:STDOUT: impl_decl @EE.as.Z.impl [concrete] {} {
  1654. // CHECK:STDOUT: %EE.ref: type = name_ref EE, file.%EE.decl [concrete = constants.%EE]
  1655. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1656. // CHECK:STDOUT: }
  1657. // CHECK:STDOUT: %DD.decl: %DD.type = class_decl @DD [concrete = constants.%DD.generic] {
  1658. // CHECK:STDOUT: %E.patt: %pattern_type.98f = symbolic_binding_pattern E, 0 [concrete]
  1659. // CHECK:STDOUT: } {
  1660. // CHECK:STDOUT: %.loc8_14.1: type = splice_block %.loc8_14.2 [concrete = type] {
  1661. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1662. // CHECK:STDOUT: %.loc8_14.2: type = type_literal type [concrete = type]
  1663. // CHECK:STDOUT: }
  1664. // CHECK:STDOUT: %E.loc8_11.2: type = symbolic_binding E, 0 [symbolic = %E.loc8_11.1 (constants.%E)]
  1665. // CHECK:STDOUT: }
  1666. // CHECK:STDOUT: impl_decl @DD.as.Z.impl [concrete] {
  1667. // CHECK:STDOUT: %E.patt: %pattern_type.98f = symbolic_binding_pattern E, 0 [concrete]
  1668. // CHECK:STDOUT: } {
  1669. // CHECK:STDOUT: %DD.ref: %DD.type = name_ref DD, file.%DD.decl [concrete = constants.%DD.generic]
  1670. // CHECK:STDOUT: %E.ref: type = name_ref E, %E.loc9_15.1 [symbolic = %E.loc9_15.2 (constants.%E)]
  1671. // CHECK:STDOUT: %DD.loc9_28.1: type = class_type @DD, @DD(constants.%E) [symbolic = %DD.loc9_28.2 (constants.%DD.a29)]
  1672. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1673. // CHECK:STDOUT: %.loc9_18.1: type = splice_block %.loc9_18.2 [concrete = type] {
  1674. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1675. // CHECK:STDOUT: %.loc9_18.2: type = type_literal type [concrete = type]
  1676. // CHECK:STDOUT: }
  1677. // CHECK:STDOUT: %E.loc9_15.1: type = symbolic_binding E, 0 [symbolic = %E.loc9_15.2 (constants.%E)]
  1678. // CHECK:STDOUT: }
  1679. // CHECK:STDOUT: %CC.decl: %CC.type = class_decl @CC [concrete = constants.%CC.generic] {
  1680. // CHECK:STDOUT: %D.patt: %pattern_type.22b = symbolic_binding_pattern D, 0 [concrete]
  1681. // CHECK:STDOUT: } {
  1682. // CHECK:STDOUT: %.loc11: type = splice_block %Z.ref [concrete = constants.%Z.type] {
  1683. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1684. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1685. // CHECK:STDOUT: }
  1686. // CHECK:STDOUT: %D.loc11_11.2: %Z.type = symbolic_binding D, 0 [symbolic = %D.loc11_11.1 (constants.%D)]
  1687. // CHECK:STDOUT: }
  1688. // CHECK:STDOUT: impl_decl @CC.as.Z.impl [concrete] {
  1689. // CHECK:STDOUT: %E.patt: %pattern_type.98f = symbolic_binding_pattern E, 0 [concrete]
  1690. // CHECK:STDOUT: } {
  1691. // CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic]
  1692. // CHECK:STDOUT: %DD.ref: %DD.type = name_ref DD, file.%DD.decl [concrete = constants.%DD.generic]
  1693. // CHECK:STDOUT: %E.ref: type = name_ref E, %E.loc12_15.1 [symbolic = %E.loc12_15.2 (constants.%E)]
  1694. // CHECK:STDOUT: %DD.loc12_31.1: type = class_type @DD, @DD(constants.%E) [symbolic = %DD.loc12_31.2 (constants.%DD.a29)]
  1695. // CHECK:STDOUT: %Z.facet.loc12_32.1: %Z.type = facet_value %DD.loc12_31.1, (constants.%Z.lookup_impl_witness) [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.892)]
  1696. // CHECK:STDOUT: %.loc12_32.1: %Z.type = converted %DD.loc12_31.1, %Z.facet.loc12_32.1 [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.892)]
  1697. // CHECK:STDOUT: %CC.loc12_32.1: type = class_type @CC, @CC(constants.%Z.facet.892) [symbolic = %CC.loc12_32.2 (constants.%CC.4e1)]
  1698. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1699. // CHECK:STDOUT: %.loc12_18.1: type = splice_block %.loc12_18.2 [concrete = type] {
  1700. // CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
  1701. // CHECK:STDOUT: %.loc12_18.2: type = type_literal type [concrete = type]
  1702. // CHECK:STDOUT: }
  1703. // CHECK:STDOUT: %E.loc12_15.1: type = symbolic_binding E, 0 [symbolic = %E.loc12_15.2 (constants.%E)]
  1704. // CHECK:STDOUT: }
  1705. // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
  1706. // CHECK:STDOUT: }
  1707. // CHECK:STDOUT:
  1708. // CHECK:STDOUT: interface @Z {
  1709. // CHECK:STDOUT: %Self: %Z.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
  1710. // CHECK:STDOUT: %Z.WithSelf.decl = interface_with_self_decl @Z [concrete]
  1711. // CHECK:STDOUT:
  1712. // CHECK:STDOUT: !members:
  1713. // CHECK:STDOUT: .Self = %Self
  1714. // CHECK:STDOUT: witness = ()
  1715. // CHECK:STDOUT:
  1716. // CHECK:STDOUT: !requires:
  1717. // CHECK:STDOUT: }
  1718. // CHECK:STDOUT:
  1719. // CHECK:STDOUT: impl @EE.as.Z.impl: %EE.ref as %Z.ref {
  1720. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @EE.as.Z.impl [concrete]
  1721. // CHECK:STDOUT: %Z.impl_witness: <witness> = impl_witness %Z.impl_witness_table [concrete = constants.%Z.impl_witness.c05]
  1722. // CHECK:STDOUT:
  1723. // CHECK:STDOUT: !members:
  1724. // CHECK:STDOUT: witness = %Z.impl_witness
  1725. // CHECK:STDOUT: }
  1726. // CHECK:STDOUT:
  1727. // CHECK:STDOUT: generic impl @DD.as.Z.impl(%E.loc9_15.1: type) {
  1728. // CHECK:STDOUT: %E.loc9_15.2: type = symbolic_binding E, 0 [symbolic = %E.loc9_15.2 (constants.%E)]
  1729. // CHECK:STDOUT: %DD.loc9_28.2: type = class_type @DD, @DD(%E.loc9_15.2) [symbolic = %DD.loc9_28.2 (constants.%DD.a29)]
  1730. // CHECK:STDOUT: %Z.impl_witness.loc9_35.2: <witness> = impl_witness %Z.impl_witness_table, @DD.as.Z.impl(%E.loc9_15.2) [symbolic = %Z.impl_witness.loc9_35.2 (constants.%Z.impl_witness.437)]
  1731. // CHECK:STDOUT:
  1732. // CHECK:STDOUT: !definition:
  1733. // CHECK:STDOUT:
  1734. // CHECK:STDOUT: impl: %DD.loc9_28.1 as %Z.ref {
  1735. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @DD.as.Z.impl [concrete]
  1736. // CHECK:STDOUT: %Z.impl_witness.loc9_35.1: <witness> = impl_witness %Z.impl_witness_table, @DD.as.Z.impl(constants.%E) [symbolic = %Z.impl_witness.loc9_35.2 (constants.%Z.impl_witness.437)]
  1737. // CHECK:STDOUT:
  1738. // CHECK:STDOUT: !members:
  1739. // CHECK:STDOUT: witness = %Z.impl_witness.loc9_35.1
  1740. // CHECK:STDOUT: }
  1741. // CHECK:STDOUT: }
  1742. // CHECK:STDOUT:
  1743. // CHECK:STDOUT: generic impl @CC.as.Z.impl(%E.loc12_15.1: type) {
  1744. // CHECK:STDOUT: %E.loc12_15.2: type = symbolic_binding E, 0 [symbolic = %E.loc12_15.2 (constants.%E)]
  1745. // CHECK:STDOUT: %DD.loc12_31.2: type = class_type @DD, @DD(%E.loc12_15.2) [symbolic = %DD.loc12_31.2 (constants.%DD.a29)]
  1746. // CHECK:STDOUT: %Z.lookup_impl_witness: <witness> = lookup_impl_witness %DD.loc12_31.2, @Z [symbolic = %Z.lookup_impl_witness (constants.%Z.lookup_impl_witness)]
  1747. // CHECK:STDOUT: %.loc12_32.2: require_specific_def_type = require_specific_def @DD.as.Z.impl(%E.loc12_15.2) [symbolic = %.loc12_32.2 (constants.%.bf4)]
  1748. // CHECK:STDOUT: %Z.facet.loc12_32.2: %Z.type = facet_value %DD.loc12_31.2, (%Z.lookup_impl_witness) [symbolic = %Z.facet.loc12_32.2 (constants.%Z.facet.892)]
  1749. // CHECK:STDOUT: %CC.loc12_32.2: type = class_type @CC, @CC(%Z.facet.loc12_32.2) [symbolic = %CC.loc12_32.2 (constants.%CC.4e1)]
  1750. // CHECK:STDOUT: %Z.impl_witness.loc12_39.2: <witness> = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(%E.loc12_15.2) [symbolic = %Z.impl_witness.loc12_39.2 (constants.%Z.impl_witness.40e)]
  1751. // CHECK:STDOUT:
  1752. // CHECK:STDOUT: !definition:
  1753. // CHECK:STDOUT:
  1754. // CHECK:STDOUT: impl: %CC.loc12_32.1 as %Z.ref {
  1755. // CHECK:STDOUT: %Z.impl_witness_table = impl_witness_table (), @CC.as.Z.impl [concrete]
  1756. // CHECK:STDOUT: %Z.impl_witness.loc12_39.1: <witness> = impl_witness %Z.impl_witness_table, @CC.as.Z.impl(constants.%E) [symbolic = %Z.impl_witness.loc12_39.2 (constants.%Z.impl_witness.40e)]
  1757. // CHECK:STDOUT:
  1758. // CHECK:STDOUT: !members:
  1759. // CHECK:STDOUT: witness = %Z.impl_witness.loc12_39.1
  1760. // CHECK:STDOUT: }
  1761. // CHECK:STDOUT: }
  1762. // CHECK:STDOUT:
  1763. // CHECK:STDOUT: class @EE {
  1764. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1765. // CHECK:STDOUT: complete_type_witness = %complete_type
  1766. // CHECK:STDOUT:
  1767. // CHECK:STDOUT: !members:
  1768. // CHECK:STDOUT: .Self = constants.%EE
  1769. // CHECK:STDOUT: }
  1770. // CHECK:STDOUT:
  1771. // CHECK:STDOUT: generic class @DD(%E.loc8_11.2: type) {
  1772. // CHECK:STDOUT: %E.loc8_11.1: type = symbolic_binding E, 0 [symbolic = %E.loc8_11.1 (constants.%E)]
  1773. // CHECK:STDOUT:
  1774. // CHECK:STDOUT: !definition:
  1775. // CHECK:STDOUT:
  1776. // CHECK:STDOUT: class {
  1777. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1778. // CHECK:STDOUT: complete_type_witness = %complete_type
  1779. // CHECK:STDOUT:
  1780. // CHECK:STDOUT: !members:
  1781. // CHECK:STDOUT: .Self = constants.%DD.a29
  1782. // CHECK:STDOUT: }
  1783. // CHECK:STDOUT: }
  1784. // CHECK:STDOUT:
  1785. // CHECK:STDOUT: generic class @CC(%D.loc11_11.2: %Z.type) {
  1786. // CHECK:STDOUT: %D.loc11_11.1: %Z.type = symbolic_binding D, 0 [symbolic = %D.loc11_11.1 (constants.%D)]
  1787. // CHECK:STDOUT:
  1788. // CHECK:STDOUT: !definition:
  1789. // CHECK:STDOUT:
  1790. // CHECK:STDOUT: class {
  1791. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
  1792. // CHECK:STDOUT: complete_type_witness = %complete_type
  1793. // CHECK:STDOUT:
  1794. // CHECK:STDOUT: !members:
  1795. // CHECK:STDOUT: .Self = constants.%CC.a1b
  1796. // CHECK:STDOUT: }
  1797. // CHECK:STDOUT: }
  1798. // CHECK:STDOUT:
  1799. // CHECK:STDOUT: fn @F() {
  1800. // CHECK:STDOUT: !entry:
  1801. // CHECK:STDOUT: %CC.ref: %CC.type = name_ref CC, file.%CC.decl [concrete = constants.%CC.generic]
  1802. // CHECK:STDOUT: %DD.ref: %DD.type = name_ref DD, file.%DD.decl [concrete = constants.%DD.generic]
  1803. // CHECK:STDOUT: %EE.ref: type = name_ref EE, file.%EE.decl [concrete = constants.%EE]
  1804. // CHECK:STDOUT: %DD: type = class_type @DD, @DD(constants.%EE) [concrete = constants.%DD.2e1]
  1805. // CHECK:STDOUT: %Z.facet.loc15_12: %Z.type = facet_value %DD, (constants.%Z.impl_witness.8a3) [concrete = constants.%Z.facet.74c]
  1806. // CHECK:STDOUT: %.loc15_12: %Z.type = converted %DD, %Z.facet.loc15_12 [concrete = constants.%Z.facet.74c]
  1807. // CHECK:STDOUT: %CC: type = class_type @CC, @CC(constants.%Z.facet.74c) [concrete = constants.%CC.b19]
  1808. // CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
  1809. // CHECK:STDOUT: %Z.facet.loc15_14: %Z.type = facet_value %CC, (constants.%Z.impl_witness.cb4) [concrete = constants.%Z.facet.145]
  1810. // CHECK:STDOUT: %.loc15_14: %Z.type = converted %CC, %Z.facet.loc15_14 [concrete = constants.%Z.facet.145]
  1811. // CHECK:STDOUT: return
  1812. // CHECK:STDOUT: }
  1813. // CHECK:STDOUT:
  1814. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Self) {
  1815. // CHECK:STDOUT: !definition:
  1816. // CHECK:STDOUT: }
  1817. // CHECK:STDOUT:
  1818. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Z.facet.5dc) {
  1819. // CHECK:STDOUT: !definition:
  1820. // CHECK:STDOUT: }
  1821. // CHECK:STDOUT:
  1822. // CHECK:STDOUT: specific @DD(constants.%E) {
  1823. // CHECK:STDOUT: %E.loc8_11.1 => constants.%E
  1824. // CHECK:STDOUT: }
  1825. // CHECK:STDOUT:
  1826. // CHECK:STDOUT: specific @DD.as.Z.impl(constants.%E) {
  1827. // CHECK:STDOUT: %E.loc9_15.2 => constants.%E
  1828. // CHECK:STDOUT: %DD.loc9_28.2 => constants.%DD.a29
  1829. // CHECK:STDOUT: %Z.impl_witness.loc9_35.2 => constants.%Z.impl_witness.437
  1830. // CHECK:STDOUT:
  1831. // CHECK:STDOUT: !definition:
  1832. // CHECK:STDOUT: }
  1833. // CHECK:STDOUT:
  1834. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Z.facet.dc0) {
  1835. // CHECK:STDOUT: !definition:
  1836. // CHECK:STDOUT: }
  1837. // CHECK:STDOUT:
  1838. // CHECK:STDOUT: specific @CC(constants.%D) {
  1839. // CHECK:STDOUT: %D.loc11_11.1 => constants.%D
  1840. // CHECK:STDOUT: }
  1841. // CHECK:STDOUT:
  1842. // CHECK:STDOUT: specific @CC(constants.%Z.facet.892) {
  1843. // CHECK:STDOUT: %D.loc11_11.1 => constants.%Z.facet.892
  1844. // CHECK:STDOUT: }
  1845. // CHECK:STDOUT:
  1846. // CHECK:STDOUT: specific @CC.as.Z.impl(constants.%E) {
  1847. // CHECK:STDOUT: %E.loc12_15.2 => constants.%E
  1848. // CHECK:STDOUT: %DD.loc12_31.2 => constants.%DD.a29
  1849. // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.lookup_impl_witness
  1850. // CHECK:STDOUT: %.loc12_32.2 => constants.%.bf4
  1851. // CHECK:STDOUT: %Z.facet.loc12_32.2 => constants.%Z.facet.892
  1852. // CHECK:STDOUT: %CC.loc12_32.2 => constants.%CC.4e1
  1853. // CHECK:STDOUT: %Z.impl_witness.loc12_39.2 => constants.%Z.impl_witness.40e
  1854. // CHECK:STDOUT: }
  1855. // CHECK:STDOUT:
  1856. // CHECK:STDOUT: specific @Z.WithSelf(constants.%Z.facet.b7b) {
  1857. // CHECK:STDOUT: !definition:
  1858. // CHECK:STDOUT: }
  1859. // CHECK:STDOUT:
  1860. // CHECK:STDOUT: specific @DD(constants.%EE) {
  1861. // CHECK:STDOUT: %E.loc8_11.1 => constants.%EE
  1862. // CHECK:STDOUT: }
  1863. // CHECK:STDOUT:
  1864. // CHECK:STDOUT: specific @DD.as.Z.impl(constants.%EE) {
  1865. // CHECK:STDOUT: %E.loc9_15.2 => constants.%EE
  1866. // CHECK:STDOUT: %DD.loc9_28.2 => constants.%DD.2e1
  1867. // CHECK:STDOUT: %Z.impl_witness.loc9_35.2 => constants.%Z.impl_witness.8a3
  1868. // CHECK:STDOUT:
  1869. // CHECK:STDOUT: !definition:
  1870. // CHECK:STDOUT: }
  1871. // CHECK:STDOUT:
  1872. // CHECK:STDOUT: specific @CC(constants.%Z.facet.74c) {
  1873. // CHECK:STDOUT: %D.loc11_11.1 => constants.%Z.facet.74c
  1874. // CHECK:STDOUT: }
  1875. // CHECK:STDOUT:
  1876. // CHECK:STDOUT: specific @CC.as.Z.impl(constants.%EE) {
  1877. // CHECK:STDOUT: %E.loc12_15.2 => constants.%EE
  1878. // CHECK:STDOUT: %DD.loc12_31.2 => constants.%DD.2e1
  1879. // CHECK:STDOUT: %Z.lookup_impl_witness => constants.%Z.impl_witness.8a3
  1880. // CHECK:STDOUT: %.loc12_32.2 => constants.%.36d
  1881. // CHECK:STDOUT: %Z.facet.loc12_32.2 => constants.%Z.facet.74c
  1882. // CHECK:STDOUT: %CC.loc12_32.2 => constants.%CC.b19
  1883. // CHECK:STDOUT: %Z.impl_witness.loc12_39.2 => constants.%Z.impl_witness.cb4
  1884. // CHECK:STDOUT:
  1885. // CHECK:STDOUT: !definition:
  1886. // CHECK:STDOUT: }
  1887. // CHECK:STDOUT: