deduce.carbon 102 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/deduce.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/deduce.carbon
  10. // --- deduce_explicit.carbon
  11. library "[[@TEST_NAME]]";
  12. fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  13. fn CallExplicitGenericParam() -> i32* {
  14. return ExplicitGenericParam(i32);
  15. }
  16. fn CallExplicitGenericParamWithGenericArg(T:! type) -> {.a: T}* {
  17. return ExplicitGenericParam({.a: T});
  18. }
  19. // --- fail_deduce_explicit_non_constant.carbon
  20. library "[[@TEST_NAME]]";
  21. fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  22. fn CallExplicitGenericParamConst(T:! type) {
  23. ExplicitGenericParam(T);
  24. }
  25. fn CallExplicitGenericParamNonConst(T: type) {
  26. // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE+7]]:3: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant]
  27. // CHECK:STDERR: ExplicitGenericParam(T);
  28. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
  29. // CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE-10]]:25: note: initializing generic parameter `T` declared here [InitializingGenericParam]
  30. // CHECK:STDERR: fn ExplicitGenericParam(T:! type) -> T* { return ExplicitGenericParam(T); }
  31. // CHECK:STDERR: ^
  32. // CHECK:STDERR:
  33. ExplicitGenericParam(T);
  34. }
  35. // --- explicit_vs_deduced.carbon
  36. library "[[@TEST_NAME]]";
  37. class A {}
  38. fn ExplicitAndAlsoDeduced(T:! type, x: T) -> T* {
  39. return ExplicitAndAlsoDeduced(T, x);
  40. }
  41. fn CallExplicitAndAlsoDeduced() -> A* {
  42. return ExplicitAndAlsoDeduced(A, {});
  43. }
  44. // --- deduce_implicit.carbon
  45. library "[[@TEST_NAME]]";
  46. fn ImplicitGenericParam[T:! type](x: T) -> T* { return ImplicitGenericParam(x); }
  47. fn CallImplicitGenericParam(n: i32) -> i32* {
  48. return ImplicitGenericParam(n);
  49. }
  50. // --- deduce_nested_tuple.carbon
  51. library "[[@TEST_NAME]]";
  52. fn TupleParam[T:! type](x: (T, i32)) {}
  53. fn CallTupleParam() {
  54. TupleParam((1, 2));
  55. }
  56. // --- deduce_nested_struct.carbon
  57. library "[[@TEST_NAME]]";
  58. fn StructParam[T:! type](x: {.a: T, .b: i32}) {}
  59. fn CallStructParam() {
  60. StructParam({.a = 1, .b = 2});
  61. }
  62. // --- fail_deduce_bigger_struct.carbon
  63. library "[[@TEST_NAME]]";
  64. fn BigStructParam[T:! type](x: {.c: T, .d: i32, .e: i32}) {}
  65. fn CallBigStructParam() {
  66. // CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  67. // CHECK:STDERR: BigStructParam({.c = 3, .d = 4});
  68. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  69. // CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  70. // CHECK:STDERR: fn BigStructParam[T:! type](x: {.c: T, .d: i32, .e: i32}) {}
  71. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  72. // CHECK:STDERR:
  73. BigStructParam({.c = 3, .d = 4});
  74. }
  75. // --- fail_deduce_smaller_struct.carbon
  76. library "[[@TEST_NAME]]";
  77. fn SmallStructParam[T:! type](x: {.f: T, .g: i32}) {}
  78. fn CallSmallStructParam() {
  79. // CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  80. // CHECK:STDERR: SmallStructParam({.f = 5, .g = 6, .h = 7});
  81. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82. // CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  83. // CHECK:STDERR: fn SmallStructParam[T:! type](x: {.f: T, .g: i32}) {}
  84. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. // CHECK:STDERR:
  86. SmallStructParam({.f = 5, .g = 6, .h = 7});
  87. }
  88. // --- fail_deduce_struct_wrong_name.carbon
  89. library "[[@TEST_NAME]]";
  90. fn WrongNameStructParam[T:! type](x: {.i: T, .different: i32}) {}
  91. fn CallWrongNameStructParam() {
  92. // CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  93. // CHECK:STDERR: WrongNameStructParam({.i = 8, .j = 9});
  94. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  95. // CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  96. // CHECK:STDERR: fn WrongNameStructParam[T:! type](x: {.i: T, .different: i32}) {}
  97. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98. // CHECK:STDERR:
  99. WrongNameStructParam({.i = 8, .j = 9});
  100. }
  101. // --- fail_todo_deduce_struct_wrong_order.carbon
  102. library "[[@TEST_NAME]]";
  103. fn WrongOrderStructParam[T:! type](x: {.first: T, .second: i32}) {}
  104. fn CallWrongOrderStructParam() {
  105. // CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
  106. // CHECK:STDERR: WrongOrderStructParam({.second = 11, .first = 10});
  107. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108. // CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  109. // CHECK:STDERR: fn WrongOrderStructParam[T:! type](x: {.first: T, .second: i32}) {}
  110. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  111. // CHECK:STDERR:
  112. WrongOrderStructParam({.second = 11, .first = 10});
  113. }
  114. // --- fail_deduce_incomplete.carbon
  115. library "[[@TEST_NAME]]";
  116. // TODO: It would be nice to diagnose this at its point of declaration, because
  117. // U is not deducible.
  118. fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U;
  119. fn CallImplicitNotDeducible() {
  120. // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `U` [DeductionIncomplete]
  121. // CHECK:STDERR: ImplicitNotDeducible(42);
  122. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
  123. // CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  124. // CHECK:STDERR: fn ImplicitNotDeducible[T:! type, U:! type](x: T) -> U;
  125. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  126. // CHECK:STDERR:
  127. ImplicitNotDeducible(42);
  128. }
  129. // --- fail_deduce_inconsistent.carbon
  130. library "[[@TEST_NAME]]";
  131. fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T;
  132. fn CallImplicitNotDeducible() {
  133. // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+7]]:3: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent]
  134. // CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12});
  135. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  136. // CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
  137. // CHECK:STDERR: fn ImplicitNotDeducible[T:! type](x: T, y: T) -> T;
  138. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  139. // CHECK:STDERR:
  140. ImplicitNotDeducible(42, {.x = 12});
  141. }
  142. // CHECK:STDOUT: --- deduce_explicit.carbon
  143. // CHECK:STDOUT:
  144. // CHECK:STDOUT: constants {
  145. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  146. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  147. // CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic]
  148. // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [template]
  149. // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [template]
  150. // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
  151. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.c0a: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic]
  152. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  153. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  154. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template]
  155. // CHECK:STDOUT: %CallExplicitGenericParam.type: type = fn_type @CallExplicitGenericParam [template]
  156. // CHECK:STDOUT: %CallExplicitGenericParam: %CallExplicitGenericParam.type = struct_value () [template]
  157. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.74e: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%i32) [template]
  158. // CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %T} [symbolic]
  159. // CHECK:STDOUT: %ptr.48a: type = ptr_type %struct_type.a [symbolic]
  160. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.type: type = fn_type @CallExplicitGenericParamWithGenericArg [template]
  161. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg: %CallExplicitGenericParamWithGenericArg.type = struct_value () [template]
  162. // CHECK:STDOUT: %require_complete.86d: <witness> = require_complete_type %ptr.48a [symbolic]
  163. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.6ad: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a) [symbolic]
  164. // CHECK:STDOUT: %complete_type.3d0: <witness> = complete_type_witness %ptr.235 [template]
  165. // CHECK:STDOUT: }
  166. // CHECK:STDOUT:
  167. // CHECK:STDOUT: imports {
  168. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  169. // CHECK:STDOUT: .Int = %Core.Int
  170. // CHECK:STDOUT: import Core//prelude
  171. // CHECK:STDOUT: import Core//prelude/...
  172. // CHECK:STDOUT: }
  173. // CHECK:STDOUT: }
  174. // CHECK:STDOUT:
  175. // CHECK:STDOUT: file {
  176. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  177. // CHECK:STDOUT: .Core = imports.%Core
  178. // CHECK:STDOUT: .ExplicitGenericParam = %ExplicitGenericParam.decl
  179. // CHECK:STDOUT: .CallExplicitGenericParam = %CallExplicitGenericParam.decl
  180. // CHECK:STDOUT: .CallExplicitGenericParamWithGenericArg = %CallExplicitGenericParamWithGenericArg.decl
  181. // CHECK:STDOUT: }
  182. // CHECK:STDOUT: %Core.import = import Core
  183. // CHECK:STDOUT: %ExplicitGenericParam.decl: %ExplicitGenericParam.type = fn_decl @ExplicitGenericParam [template = constants.%ExplicitGenericParam] {
  184. // CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  185. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_25.1, runtime_param<none> [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  186. // CHECK:STDOUT: %return.patt: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = return_slot_pattern
  187. // CHECK:STDOUT: %return.param_patt: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = out_param_pattern %return.patt, runtime_param0
  188. // CHECK:STDOUT: } {
  189. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  190. // CHECK:STDOUT: %ptr.loc4_39.1: type = ptr_type %T [symbolic = %ptr.loc4_39.2 (constants.%ptr.79f)]
  191. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  192. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)]
  193. // CHECK:STDOUT: %return.param: ref @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = out_param runtime_param0
  194. // CHECK:STDOUT: %return: ref @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = return_slot %return.param
  195. // CHECK:STDOUT: }
  196. // CHECK:STDOUT: %CallExplicitGenericParam.decl: %CallExplicitGenericParam.type = fn_decl @CallExplicitGenericParam [template = constants.%CallExplicitGenericParam] {
  197. // CHECK:STDOUT: %return.patt: %ptr.235 = return_slot_pattern
  198. // CHECK:STDOUT: %return.param_patt: %ptr.235 = out_param_pattern %return.patt, runtime_param0
  199. // CHECK:STDOUT: } {
  200. // CHECK:STDOUT: %int_32.loc6: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  201. // CHECK:STDOUT: %i32.loc6: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  202. // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.235]
  203. // CHECK:STDOUT: %return.param: ref %ptr.235 = out_param runtime_param0
  204. // CHECK:STDOUT: %return: ref %ptr.235 = return_slot %return.param
  205. // CHECK:STDOUT: }
  206. // CHECK:STDOUT: %CallExplicitGenericParamWithGenericArg.decl: %CallExplicitGenericParamWithGenericArg.type = fn_decl @CallExplicitGenericParamWithGenericArg [template = constants.%CallExplicitGenericParamWithGenericArg] {
  207. // CHECK:STDOUT: %T.patt.loc10_43.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_43.2 (constants.%T.patt)]
  208. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc10_43.1, runtime_param<none> [symbolic = %T.patt.loc10_43.2 (constants.%T.patt)]
  209. // CHECK:STDOUT: %return.patt: @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = return_slot_pattern
  210. // CHECK:STDOUT: %return.param_patt: @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = out_param_pattern %return.patt, runtime_param0
  211. // CHECK:STDOUT: } {
  212. // CHECK:STDOUT: %T.ref.loc10: type = name_ref T, %T.loc10_43.1 [symbolic = %T.loc10_43.2 (constants.%T)]
  213. // CHECK:STDOUT: %struct_type.a.loc10_62.1: type = struct_type {.a: %T} [symbolic = %struct_type.a.loc10_62.2 (constants.%struct_type.a)]
  214. // CHECK:STDOUT: %ptr.loc10_63.1: type = ptr_type %struct_type.a [symbolic = %ptr.loc10_63.2 (constants.%ptr.48a)]
  215. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  216. // CHECK:STDOUT: %T.loc10_43.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc10_43.2 (constants.%T)]
  217. // CHECK:STDOUT: %return.param: ref @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = out_param runtime_param0
  218. // CHECK:STDOUT: %return: ref @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = return_slot %return.param
  219. // CHECK:STDOUT: }
  220. // CHECK:STDOUT: }
  221. // CHECK:STDOUT:
  222. // CHECK:STDOUT: generic fn @ExplicitGenericParam(%T.loc4_25.1: type) {
  223. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  224. // CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  225. // CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type @ExplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_39.2 (constants.%ptr.79f)]
  226. // CHECK:STDOUT:
  227. // CHECK:STDOUT: !definition:
  228. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) [symbolic = %require_complete (constants.%require_complete.6e5)]
  229. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn.c0a)]
  230. // CHECK:STDOUT:
  231. // CHECK:STDOUT: fn(%T.param_patt: type) -> @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) {
  232. // CHECK:STDOUT: !entry:
  233. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam]
  234. // CHECK:STDOUT: %T.ref.loc4_71: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  235. // 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.c0a)]
  236. // CHECK:STDOUT: %ExplicitGenericParam.call: init @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = call %ExplicitGenericParam.specific_fn.loc4_50.1()
  237. // CHECK:STDOUT: %.loc4_73.1: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = value_of_initializer %ExplicitGenericParam.call
  238. // CHECK:STDOUT: %.loc4_73.2: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr.79f) = converted %ExplicitGenericParam.call, %.loc4_73.1
  239. // CHECK:STDOUT: return %.loc4_73.2
  240. // CHECK:STDOUT: }
  241. // CHECK:STDOUT: }
  242. // CHECK:STDOUT:
  243. // CHECK:STDOUT: fn @CallExplicitGenericParam() -> %ptr.235 {
  244. // CHECK:STDOUT: !entry:
  245. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam]
  246. // CHECK:STDOUT: %int_32.loc7: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  247. // CHECK:STDOUT: %i32.loc7: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  248. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn: <specific function> = specific_function %ExplicitGenericParam.ref, @ExplicitGenericParam(constants.%i32) [template = constants.%ExplicitGenericParam.specific_fn.74e]
  249. // CHECK:STDOUT: %ExplicitGenericParam.call: init %ptr.235 = call %ExplicitGenericParam.specific_fn()
  250. // CHECK:STDOUT: %.loc7_35.1: %ptr.235 = value_of_initializer %ExplicitGenericParam.call
  251. // CHECK:STDOUT: %.loc7_35.2: %ptr.235 = converted %ExplicitGenericParam.call, %.loc7_35.1
  252. // CHECK:STDOUT: return %.loc7_35.2
  253. // CHECK:STDOUT: }
  254. // CHECK:STDOUT:
  255. // CHECK:STDOUT: generic fn @CallExplicitGenericParamWithGenericArg(%T.loc10_43.1: type) {
  256. // CHECK:STDOUT: %T.loc10_43.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc10_43.2 (constants.%T)]
  257. // CHECK:STDOUT: %T.patt.loc10_43.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc10_43.2 (constants.%T.patt)]
  258. // CHECK:STDOUT: %struct_type.a.loc10_62.2: type = struct_type {.a: @CallExplicitGenericParamWithGenericArg.%T.loc10_43.2 (%T)} [symbolic = %struct_type.a.loc10_62.2 (constants.%struct_type.a)]
  259. // CHECK:STDOUT: %ptr.loc10_63.2: type = ptr_type @CallExplicitGenericParamWithGenericArg.%struct_type.a.loc10_62.2 (%struct_type.a) [symbolic = %ptr.loc10_63.2 (constants.%ptr.48a)]
  260. // CHECK:STDOUT:
  261. // CHECK:STDOUT: !definition:
  262. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) [symbolic = %require_complete (constants.%require_complete.86d)]
  263. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc11_10.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%struct_type.a.loc10_62.2) [symbolic = %ExplicitGenericParam.specific_fn.loc11_10.2 (constants.%ExplicitGenericParam.specific_fn.6ad)]
  264. // CHECK:STDOUT:
  265. // CHECK:STDOUT: fn(%T.param_patt: type) -> @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) {
  266. // CHECK:STDOUT: !entry:
  267. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam]
  268. // CHECK:STDOUT: %T.ref.loc11: type = name_ref T, %T.loc10_43.1 [symbolic = %T.loc10_43.2 (constants.%T)]
  269. // CHECK:STDOUT: %struct_type.a.loc11: type = struct_type {.a: %T} [symbolic = %struct_type.a.loc10_62.2 (constants.%struct_type.a)]
  270. // 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.6ad)]
  271. // CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = call %ExplicitGenericParam.specific_fn.loc11_10.1()
  272. // CHECK:STDOUT: %.loc11_39.1: @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = value_of_initializer %ExplicitGenericParam.call
  273. // CHECK:STDOUT: %.loc11_39.2: @CallExplicitGenericParamWithGenericArg.%ptr.loc10_63.2 (%ptr.48a) = converted %ExplicitGenericParam.call, %.loc11_39.1
  274. // CHECK:STDOUT: return %.loc11_39.2
  275. // CHECK:STDOUT: }
  276. // CHECK:STDOUT: }
  277. // CHECK:STDOUT:
  278. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%T) {
  279. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  280. // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T
  281. // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.79f
  282. // CHECK:STDOUT:
  283. // CHECK:STDOUT: !definition:
  284. // CHECK:STDOUT: %require_complete => constants.%require_complete.6e5
  285. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.c0a
  286. // CHECK:STDOUT: }
  287. // CHECK:STDOUT:
  288. // CHECK:STDOUT: specific @ExplicitGenericParam(%T.loc4_25.2) {}
  289. // CHECK:STDOUT:
  290. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%i32) {
  291. // CHECK:STDOUT: %T.loc4_25.2 => constants.%i32
  292. // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%i32
  293. // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.235
  294. // CHECK:STDOUT:
  295. // CHECK:STDOUT: !definition:
  296. // CHECK:STDOUT: %require_complete => constants.%complete_type.3d0
  297. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.74e
  298. // CHECK:STDOUT: }
  299. // CHECK:STDOUT:
  300. // CHECK:STDOUT: specific @CallExplicitGenericParamWithGenericArg(constants.%T) {
  301. // CHECK:STDOUT: %T.loc10_43.2 => constants.%T
  302. // CHECK:STDOUT: %T.patt.loc10_43.2 => constants.%T
  303. // CHECK:STDOUT: %struct_type.a.loc10_62.2 => constants.%struct_type.a
  304. // CHECK:STDOUT: %ptr.loc10_63.2 => constants.%ptr.48a
  305. // CHECK:STDOUT: }
  306. // CHECK:STDOUT:
  307. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%struct_type.a) {
  308. // CHECK:STDOUT: %T.loc4_25.2 => constants.%struct_type.a
  309. // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%struct_type.a
  310. // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr.48a
  311. // CHECK:STDOUT:
  312. // CHECK:STDOUT: !definition:
  313. // CHECK:STDOUT: %require_complete => constants.%require_complete.86d
  314. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn.6ad
  315. // CHECK:STDOUT: }
  316. // CHECK:STDOUT:
  317. // CHECK:STDOUT: specific @ExplicitGenericParam(@CallExplicitGenericParamWithGenericArg.%struct_type.a.loc10_62.2) {}
  318. // CHECK:STDOUT:
  319. // CHECK:STDOUT: --- fail_deduce_explicit_non_constant.carbon
  320. // CHECK:STDOUT:
  321. // CHECK:STDOUT: constants {
  322. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  323. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  324. // CHECK:STDOUT: %ptr: type = ptr_type %T [symbolic]
  325. // CHECK:STDOUT: %ExplicitGenericParam.type: type = fn_type @ExplicitGenericParam [template]
  326. // CHECK:STDOUT: %ExplicitGenericParam: %ExplicitGenericParam.type = struct_value () [template]
  327. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr [symbolic]
  328. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn: <specific function> = specific_function %ExplicitGenericParam, @ExplicitGenericParam(%T) [symbolic]
  329. // CHECK:STDOUT: %CallExplicitGenericParamConst.type: type = fn_type @CallExplicitGenericParamConst [template]
  330. // CHECK:STDOUT: %CallExplicitGenericParamConst: %CallExplicitGenericParamConst.type = struct_value () [template]
  331. // CHECK:STDOUT: %CallExplicitGenericParamNonConst.type: type = fn_type @CallExplicitGenericParamNonConst [template]
  332. // CHECK:STDOUT: %CallExplicitGenericParamNonConst: %CallExplicitGenericParamNonConst.type = struct_value () [template]
  333. // CHECK:STDOUT: }
  334. // CHECK:STDOUT:
  335. // CHECK:STDOUT: imports {
  336. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  337. // CHECK:STDOUT: import Core//prelude
  338. // CHECK:STDOUT: import Core//prelude/...
  339. // CHECK:STDOUT: }
  340. // CHECK:STDOUT: }
  341. // CHECK:STDOUT:
  342. // CHECK:STDOUT: file {
  343. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  344. // CHECK:STDOUT: .Core = imports.%Core
  345. // CHECK:STDOUT: .ExplicitGenericParam = %ExplicitGenericParam.decl
  346. // CHECK:STDOUT: .CallExplicitGenericParamConst = %CallExplicitGenericParamConst.decl
  347. // CHECK:STDOUT: .CallExplicitGenericParamNonConst = %CallExplicitGenericParamNonConst.decl
  348. // CHECK:STDOUT: }
  349. // CHECK:STDOUT: %Core.import = import Core
  350. // CHECK:STDOUT: %ExplicitGenericParam.decl: %ExplicitGenericParam.type = fn_decl @ExplicitGenericParam [template = constants.%ExplicitGenericParam] {
  351. // CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  352. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_25.1, runtime_param<none> [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  353. // CHECK:STDOUT: %return.patt: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = return_slot_pattern
  354. // CHECK:STDOUT: %return.param_patt: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = out_param_pattern %return.patt, runtime_param0
  355. // CHECK:STDOUT: } {
  356. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  357. // CHECK:STDOUT: %ptr.loc4_39.1: type = ptr_type %T [symbolic = %ptr.loc4_39.2 (constants.%ptr)]
  358. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  359. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)]
  360. // CHECK:STDOUT: %return.param: ref @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = out_param runtime_param0
  361. // CHECK:STDOUT: %return: ref @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = return_slot %return.param
  362. // CHECK:STDOUT: }
  363. // CHECK:STDOUT: %CallExplicitGenericParamConst.decl: %CallExplicitGenericParamConst.type = fn_decl @CallExplicitGenericParamConst [template = constants.%CallExplicitGenericParamConst] {
  364. // CHECK:STDOUT: %T.patt.loc6_34.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_34.2 (constants.%T.patt)]
  365. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_34.1, runtime_param<none> [symbolic = %T.patt.loc6_34.2 (constants.%T.patt)]
  366. // CHECK:STDOUT: } {
  367. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  368. // CHECK:STDOUT: %T.loc6_34.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_34.2 (constants.%T)]
  369. // CHECK:STDOUT: }
  370. // CHECK:STDOUT: %CallExplicitGenericParamNonConst.decl: %CallExplicitGenericParamNonConst.type = fn_decl @CallExplicitGenericParamNonConst [template = constants.%CallExplicitGenericParamNonConst] {
  371. // CHECK:STDOUT: %T.patt: type = binding_pattern T
  372. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt, runtime_param0
  373. // CHECK:STDOUT: } {
  374. // CHECK:STDOUT: %T.param: type = value_param runtime_param0
  375. // CHECK:STDOUT: %T: type = bind_name T, %T.param
  376. // CHECK:STDOUT: }
  377. // CHECK:STDOUT: }
  378. // CHECK:STDOUT:
  379. // CHECK:STDOUT: generic fn @ExplicitGenericParam(%T.loc4_25.1: type) {
  380. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  381. // CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  382. // CHECK:STDOUT: %ptr.loc4_39.2: type = ptr_type @ExplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_39.2 (constants.%ptr)]
  383. // CHECK:STDOUT:
  384. // CHECK:STDOUT: !definition:
  385. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) [symbolic = %require_complete (constants.%require_complete)]
  386. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc4_25.2) [symbolic = %ExplicitGenericParam.specific_fn.loc4_50.2 (constants.%ExplicitGenericParam.specific_fn)]
  387. // CHECK:STDOUT:
  388. // CHECK:STDOUT: fn(%T.param_patt: type) -> @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) {
  389. // CHECK:STDOUT: !entry:
  390. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam]
  391. // CHECK:STDOUT: %T.ref.loc4_71: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  392. // 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)]
  393. // CHECK:STDOUT: %ExplicitGenericParam.call: init @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = call %ExplicitGenericParam.specific_fn.loc4_50.1()
  394. // CHECK:STDOUT: %.loc4_73.1: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = value_of_initializer %ExplicitGenericParam.call
  395. // CHECK:STDOUT: %.loc4_73.2: @ExplicitGenericParam.%ptr.loc4_39.2 (%ptr) = converted %ExplicitGenericParam.call, %.loc4_73.1
  396. // CHECK:STDOUT: return %.loc4_73.2
  397. // CHECK:STDOUT: }
  398. // CHECK:STDOUT: }
  399. // CHECK:STDOUT:
  400. // CHECK:STDOUT: generic fn @CallExplicitGenericParamConst(%T.loc6_34.1: type) {
  401. // CHECK:STDOUT: %T.loc6_34.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_34.2 (constants.%T)]
  402. // CHECK:STDOUT: %T.patt.loc6_34.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_34.2 (constants.%T.patt)]
  403. // CHECK:STDOUT:
  404. // CHECK:STDOUT: !definition:
  405. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc7_3.2: <specific function> = specific_function constants.%ExplicitGenericParam, @ExplicitGenericParam(%T.loc6_34.2) [symbolic = %ExplicitGenericParam.specific_fn.loc7_3.2 (constants.%ExplicitGenericParam.specific_fn)]
  406. // CHECK:STDOUT: %ptr: type = ptr_type @CallExplicitGenericParamConst.%T.loc6_34.2 (%T) [symbolic = %ptr (constants.%ptr)]
  407. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @CallExplicitGenericParamConst.%ptr (%ptr) [symbolic = %require_complete (constants.%require_complete)]
  408. // CHECK:STDOUT:
  409. // CHECK:STDOUT: fn(%T.param_patt: type) {
  410. // CHECK:STDOUT: !entry:
  411. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam]
  412. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_34.1 [symbolic = %T.loc6_34.2 (constants.%T)]
  413. // 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)]
  414. // CHECK:STDOUT: %ExplicitGenericParam.call: init @CallExplicitGenericParamConst.%ptr (%ptr) = call %ExplicitGenericParam.specific_fn.loc7_3.1()
  415. // CHECK:STDOUT: return
  416. // CHECK:STDOUT: }
  417. // CHECK:STDOUT: }
  418. // CHECK:STDOUT:
  419. // CHECK:STDOUT: fn @CallExplicitGenericParamNonConst(%T.param_patt: type) {
  420. // CHECK:STDOUT: !entry:
  421. // CHECK:STDOUT: %ExplicitGenericParam.ref: %ExplicitGenericParam.type = name_ref ExplicitGenericParam, file.%ExplicitGenericParam.decl [template = constants.%ExplicitGenericParam]
  422. // CHECK:STDOUT: %T.ref: type = name_ref T, %T
  423. // CHECK:STDOUT: return
  424. // CHECK:STDOUT: }
  425. // CHECK:STDOUT:
  426. // CHECK:STDOUT: specific @ExplicitGenericParam(constants.%T) {
  427. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  428. // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T
  429. // CHECK:STDOUT: %ptr.loc4_39.2 => constants.%ptr
  430. // CHECK:STDOUT:
  431. // CHECK:STDOUT: !definition:
  432. // CHECK:STDOUT: %require_complete => constants.%require_complete
  433. // CHECK:STDOUT: %ExplicitGenericParam.specific_fn.loc4_50.2 => constants.%ExplicitGenericParam.specific_fn
  434. // CHECK:STDOUT: }
  435. // CHECK:STDOUT:
  436. // CHECK:STDOUT: specific @ExplicitGenericParam(%T.loc4_25.2) {}
  437. // CHECK:STDOUT:
  438. // CHECK:STDOUT: specific @CallExplicitGenericParamConst(constants.%T) {
  439. // CHECK:STDOUT: %T.loc6_34.2 => constants.%T
  440. // CHECK:STDOUT: %T.patt.loc6_34.2 => constants.%T
  441. // CHECK:STDOUT: }
  442. // CHECK:STDOUT:
  443. // CHECK:STDOUT: specific @ExplicitGenericParam(@CallExplicitGenericParamConst.%T.loc6_34.2) {}
  444. // CHECK:STDOUT:
  445. // CHECK:STDOUT: --- explicit_vs_deduced.carbon
  446. // CHECK:STDOUT:
  447. // CHECK:STDOUT: constants {
  448. // CHECK:STDOUT: %A: type = class_type @A [template]
  449. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
  450. // CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
  451. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  452. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  453. // CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic]
  454. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.type: type = fn_type @ExplicitAndAlsoDeduced [template]
  455. // CHECK:STDOUT: %ExplicitAndAlsoDeduced: %ExplicitAndAlsoDeduced.type = struct_value () [template]
  456. // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
  457. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  458. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.41d: <specific function> = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T) [symbolic]
  459. // CHECK:STDOUT: %ptr.6db: type = ptr_type %A [template]
  460. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.type: type = fn_type @CallExplicitAndAlsoDeduced [template]
  461. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced: %CallExplicitAndAlsoDeduced.type = struct_value () [template]
  462. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.720: <specific function> = specific_function %ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%A) [template]
  463. // CHECK:STDOUT: %A.val: %A = struct_value () [template]
  464. // CHECK:STDOUT: %complete_type.7ea: <witness> = complete_type_witness %ptr.6db [template]
  465. // CHECK:STDOUT: }
  466. // CHECK:STDOUT:
  467. // CHECK:STDOUT: imports {
  468. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  469. // CHECK:STDOUT: import Core//prelude
  470. // CHECK:STDOUT: import Core//prelude/...
  471. // CHECK:STDOUT: }
  472. // CHECK:STDOUT: }
  473. // CHECK:STDOUT:
  474. // CHECK:STDOUT: file {
  475. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  476. // CHECK:STDOUT: .Core = imports.%Core
  477. // CHECK:STDOUT: .A = %A.decl
  478. // CHECK:STDOUT: .ExplicitAndAlsoDeduced = %ExplicitAndAlsoDeduced.decl
  479. // CHECK:STDOUT: .CallExplicitAndAlsoDeduced = %CallExplicitAndAlsoDeduced.decl
  480. // CHECK:STDOUT: }
  481. // CHECK:STDOUT: %Core.import = import Core
  482. // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} {}
  483. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.decl: %ExplicitAndAlsoDeduced.type = fn_decl @ExplicitAndAlsoDeduced [template = constants.%ExplicitAndAlsoDeduced] {
  484. // CHECK:STDOUT: %T.patt.loc6_27.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_27.2 (constants.%T.patt)]
  485. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_27.1, runtime_param<none> [symbolic = %T.patt.loc6_27.2 (constants.%T.patt)]
  486. // CHECK:STDOUT: %x.patt: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = binding_pattern x
  487. // CHECK:STDOUT: %x.param_patt: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = value_param_pattern %x.patt, runtime_param0
  488. // CHECK:STDOUT: %return.patt: @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = return_slot_pattern
  489. // CHECK:STDOUT: %return.param_patt: @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = out_param_pattern %return.patt, runtime_param1
  490. // CHECK:STDOUT: } {
  491. // CHECK:STDOUT: %T.ref.loc6_46: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)]
  492. // CHECK:STDOUT: %ptr.loc6_47.1: type = ptr_type %T [symbolic = %ptr.loc6_47.2 (constants.%ptr.79f)]
  493. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  494. // CHECK:STDOUT: %T.loc6_27.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_27.2 (constants.%T)]
  495. // CHECK:STDOUT: %x.param: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = value_param runtime_param0
  496. // CHECK:STDOUT: %T.ref.loc6_40: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)]
  497. // CHECK:STDOUT: %x: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = bind_name x, %x.param
  498. // CHECK:STDOUT: %return.param: ref @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = out_param runtime_param1
  499. // CHECK:STDOUT: %return: ref @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = return_slot %return.param
  500. // CHECK:STDOUT: }
  501. // CHECK:STDOUT: %CallExplicitAndAlsoDeduced.decl: %CallExplicitAndAlsoDeduced.type = fn_decl @CallExplicitAndAlsoDeduced [template = constants.%CallExplicitAndAlsoDeduced] {
  502. // CHECK:STDOUT: %return.patt: %ptr.6db = return_slot_pattern
  503. // CHECK:STDOUT: %return.param_patt: %ptr.6db = out_param_pattern %return.patt, runtime_param0
  504. // CHECK:STDOUT: } {
  505. // CHECK:STDOUT: %A.ref.loc10: type = name_ref A, file.%A.decl [template = constants.%A]
  506. // CHECK:STDOUT: %ptr: type = ptr_type %A [template = constants.%ptr.6db]
  507. // CHECK:STDOUT: %return.param: ref %ptr.6db = out_param runtime_param0
  508. // CHECK:STDOUT: %return: ref %ptr.6db = return_slot %return.param
  509. // CHECK:STDOUT: }
  510. // CHECK:STDOUT: }
  511. // CHECK:STDOUT:
  512. // CHECK:STDOUT: class @A {
  513. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
  514. // CHECK:STDOUT: complete_type_witness = %complete_type
  515. // CHECK:STDOUT:
  516. // CHECK:STDOUT: !members:
  517. // CHECK:STDOUT: .Self = constants.%A
  518. // CHECK:STDOUT: }
  519. // CHECK:STDOUT:
  520. // CHECK:STDOUT: generic fn @ExplicitAndAlsoDeduced(%T.loc6_27.1: type) {
  521. // CHECK:STDOUT: %T.loc6_27.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_27.2 (constants.%T)]
  522. // CHECK:STDOUT: %T.patt.loc6_27.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_27.2 (constants.%T.patt)]
  523. // CHECK:STDOUT: %ptr.loc6_47.2: type = ptr_type @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) [symbolic = %ptr.loc6_47.2 (constants.%ptr.79f)]
  524. // CHECK:STDOUT:
  525. // CHECK:STDOUT: !definition:
  526. // CHECK:STDOUT: %require_complete.loc6_43: <witness> = require_complete_type @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) [symbolic = %require_complete.loc6_43 (constants.%require_complete.6e5)]
  527. // CHECK:STDOUT: %require_complete.loc6_38: <witness> = require_complete_type @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) [symbolic = %require_complete.loc6_38 (constants.%require_complete.4ae)]
  528. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2: <specific function> = specific_function constants.%ExplicitAndAlsoDeduced, @ExplicitAndAlsoDeduced(%T.loc6_27.2) [symbolic = %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 (constants.%ExplicitAndAlsoDeduced.specific_fn.41d)]
  529. // CHECK:STDOUT:
  530. // CHECK:STDOUT: fn(%T.param_patt: type, %x.param_patt: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T)) -> @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) {
  531. // CHECK:STDOUT: !entry:
  532. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.ref: %ExplicitAndAlsoDeduced.type = name_ref ExplicitAndAlsoDeduced, file.%ExplicitAndAlsoDeduced.decl [template = constants.%ExplicitAndAlsoDeduced]
  533. // CHECK:STDOUT: %T.ref.loc7: type = name_ref T, %T.loc6_27.1 [symbolic = %T.loc6_27.2 (constants.%T)]
  534. // CHECK:STDOUT: %x.ref: @ExplicitAndAlsoDeduced.%T.loc6_27.2 (%T) = name_ref x, %x
  535. // 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.41d)]
  536. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = call %ExplicitAndAlsoDeduced.specific_fn.loc7_10.1(%x.ref)
  537. // CHECK:STDOUT: %.loc7_38.1: @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = value_of_initializer %ExplicitAndAlsoDeduced.call
  538. // CHECK:STDOUT: %.loc7_38.2: @ExplicitAndAlsoDeduced.%ptr.loc6_47.2 (%ptr.79f) = converted %ExplicitAndAlsoDeduced.call, %.loc7_38.1
  539. // CHECK:STDOUT: return %.loc7_38.2
  540. // CHECK:STDOUT: }
  541. // CHECK:STDOUT: }
  542. // CHECK:STDOUT:
  543. // CHECK:STDOUT: fn @CallExplicitAndAlsoDeduced() -> %ptr.6db {
  544. // CHECK:STDOUT: !entry:
  545. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.ref: %ExplicitAndAlsoDeduced.type = name_ref ExplicitAndAlsoDeduced, file.%ExplicitAndAlsoDeduced.decl [template = constants.%ExplicitAndAlsoDeduced]
  546. // CHECK:STDOUT: %A.ref.loc11: type = name_ref A, file.%A.decl [template = constants.%A]
  547. // CHECK:STDOUT: %.loc11_37.1: %empty_struct_type = struct_literal ()
  548. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn: <specific function> = specific_function %ExplicitAndAlsoDeduced.ref, @ExplicitAndAlsoDeduced(constants.%A) [template = constants.%ExplicitAndAlsoDeduced.specific_fn.720]
  549. // CHECK:STDOUT: %.loc11_37.2: ref %A = temporary_storage
  550. // CHECK:STDOUT: %.loc11_37.3: init %A = class_init (), %.loc11_37.2 [template = constants.%A.val]
  551. // CHECK:STDOUT: %.loc11_37.4: ref %A = temporary %.loc11_37.2, %.loc11_37.3
  552. // CHECK:STDOUT: %.loc11_37.5: ref %A = converted %.loc11_37.1, %.loc11_37.4
  553. // CHECK:STDOUT: %.loc11_37.6: %A = bind_value %.loc11_37.5
  554. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.call: init %ptr.6db = call %ExplicitAndAlsoDeduced.specific_fn(%.loc11_37.6)
  555. // CHECK:STDOUT: %.loc11_39.1: %ptr.6db = value_of_initializer %ExplicitAndAlsoDeduced.call
  556. // CHECK:STDOUT: %.loc11_39.2: %ptr.6db = converted %ExplicitAndAlsoDeduced.call, %.loc11_39.1
  557. // CHECK:STDOUT: return %.loc11_39.2
  558. // CHECK:STDOUT: }
  559. // CHECK:STDOUT:
  560. // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%T) {
  561. // CHECK:STDOUT: %T.loc6_27.2 => constants.%T
  562. // CHECK:STDOUT: %T.patt.loc6_27.2 => constants.%T
  563. // CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.79f
  564. // CHECK:STDOUT:
  565. // CHECK:STDOUT: !definition:
  566. // CHECK:STDOUT: %require_complete.loc6_43 => constants.%require_complete.6e5
  567. // CHECK:STDOUT: %require_complete.loc6_38 => constants.%require_complete.4ae
  568. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.41d
  569. // CHECK:STDOUT: }
  570. // CHECK:STDOUT:
  571. // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(%T.loc6_27.2) {}
  572. // CHECK:STDOUT:
  573. // CHECK:STDOUT: specific @ExplicitAndAlsoDeduced(constants.%A) {
  574. // CHECK:STDOUT: %T.loc6_27.2 => constants.%A
  575. // CHECK:STDOUT: %T.patt.loc6_27.2 => constants.%A
  576. // CHECK:STDOUT: %ptr.loc6_47.2 => constants.%ptr.6db
  577. // CHECK:STDOUT:
  578. // CHECK:STDOUT: !definition:
  579. // CHECK:STDOUT: %require_complete.loc6_43 => constants.%complete_type.7ea
  580. // CHECK:STDOUT: %require_complete.loc6_38 => constants.%complete_type.357
  581. // CHECK:STDOUT: %ExplicitAndAlsoDeduced.specific_fn.loc7_10.2 => constants.%ExplicitAndAlsoDeduced.specific_fn.720
  582. // CHECK:STDOUT: }
  583. // CHECK:STDOUT:
  584. // CHECK:STDOUT: --- deduce_implicit.carbon
  585. // CHECK:STDOUT:
  586. // CHECK:STDOUT: constants {
  587. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  588. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  589. // CHECK:STDOUT: %ptr.79f: type = ptr_type %T [symbolic]
  590. // CHECK:STDOUT: %ImplicitGenericParam.type: type = fn_type @ImplicitGenericParam [template]
  591. // CHECK:STDOUT: %ImplicitGenericParam: %ImplicitGenericParam.type = struct_value () [template]
  592. // CHECK:STDOUT: %require_complete.6e5: <witness> = require_complete_type %ptr.79f [symbolic]
  593. // CHECK:STDOUT: %require_complete.4ae: <witness> = require_complete_type %T [symbolic]
  594. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.fc1: <specific function> = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%T) [symbolic]
  595. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  596. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  597. // CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template]
  598. // CHECK:STDOUT: %CallImplicitGenericParam.type: type = fn_type @CallImplicitGenericParam [template]
  599. // CHECK:STDOUT: %CallImplicitGenericParam: %CallImplicitGenericParam.type = struct_value () [template]
  600. // CHECK:STDOUT: %i32.builtin: type = int_type signed, %int_32 [template]
  601. // CHECK:STDOUT: %complete_type.f8a: <witness> = complete_type_witness %i32.builtin [template]
  602. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.752: <specific function> = specific_function %ImplicitGenericParam, @ImplicitGenericParam(%i32) [template]
  603. // CHECK:STDOUT: %complete_type.3d0: <witness> = complete_type_witness %ptr.235 [template]
  604. // CHECK:STDOUT: }
  605. // CHECK:STDOUT:
  606. // CHECK:STDOUT: imports {
  607. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  608. // CHECK:STDOUT: .Int = %Core.Int
  609. // CHECK:STDOUT: import Core//prelude
  610. // CHECK:STDOUT: import Core//prelude/...
  611. // CHECK:STDOUT: }
  612. // CHECK:STDOUT: }
  613. // CHECK:STDOUT:
  614. // CHECK:STDOUT: file {
  615. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  616. // CHECK:STDOUT: .Core = imports.%Core
  617. // CHECK:STDOUT: .ImplicitGenericParam = %ImplicitGenericParam.decl
  618. // CHECK:STDOUT: .CallImplicitGenericParam = %CallImplicitGenericParam.decl
  619. // CHECK:STDOUT: }
  620. // CHECK:STDOUT: %Core.import = import Core
  621. // CHECK:STDOUT: %ImplicitGenericParam.decl: %ImplicitGenericParam.type = fn_decl @ImplicitGenericParam [template = constants.%ImplicitGenericParam] {
  622. // CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  623. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_25.1, runtime_param<none> [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  624. // CHECK:STDOUT: %x.patt: @ImplicitGenericParam.%T.loc4_25.2 (%T) = binding_pattern x
  625. // CHECK:STDOUT: %x.param_patt: @ImplicitGenericParam.%T.loc4_25.2 (%T) = value_param_pattern %x.patt, runtime_param0
  626. // CHECK:STDOUT: %return.patt: @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = return_slot_pattern
  627. // CHECK:STDOUT: %return.param_patt: @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = out_param_pattern %return.patt, runtime_param1
  628. // CHECK:STDOUT: } {
  629. // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  630. // CHECK:STDOUT: %ptr.loc4_45.1: type = ptr_type %T [symbolic = %ptr.loc4_45.2 (constants.%ptr.79f)]
  631. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  632. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)]
  633. // CHECK:STDOUT: %x.param: @ImplicitGenericParam.%T.loc4_25.2 (%T) = value_param runtime_param0
  634. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  635. // CHECK:STDOUT: %x: @ImplicitGenericParam.%T.loc4_25.2 (%T) = bind_name x, %x.param
  636. // CHECK:STDOUT: %return.param: ref @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = out_param runtime_param1
  637. // CHECK:STDOUT: %return: ref @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = return_slot %return.param
  638. // CHECK:STDOUT: }
  639. // CHECK:STDOUT: %CallImplicitGenericParam.decl: %CallImplicitGenericParam.type = fn_decl @CallImplicitGenericParam [template = constants.%CallImplicitGenericParam] {
  640. // CHECK:STDOUT: %n.patt: %i32 = binding_pattern n
  641. // CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0
  642. // CHECK:STDOUT: %return.patt: %ptr.235 = return_slot_pattern
  643. // CHECK:STDOUT: %return.param_patt: %ptr.235 = out_param_pattern %return.patt, runtime_param1
  644. // CHECK:STDOUT: } {
  645. // CHECK:STDOUT: %int_32.loc6_40: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  646. // CHECK:STDOUT: %i32.loc6_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  647. // CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.235]
  648. // CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0
  649. // CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_32 [template = constants.%i32] {
  650. // CHECK:STDOUT: %int_32.loc6_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  651. // CHECK:STDOUT: %i32.loc6_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  652. // CHECK:STDOUT: }
  653. // CHECK:STDOUT: %n: %i32 = bind_name n, %n.param
  654. // CHECK:STDOUT: %return.param: ref %ptr.235 = out_param runtime_param1
  655. // CHECK:STDOUT: %return: ref %ptr.235 = return_slot %return.param
  656. // CHECK:STDOUT: }
  657. // CHECK:STDOUT: }
  658. // CHECK:STDOUT:
  659. // CHECK:STDOUT: generic fn @ImplicitGenericParam(%T.loc4_25.1: type) {
  660. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  661. // CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  662. // CHECK:STDOUT: %ptr.loc4_45.2: type = ptr_type @ImplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %ptr.loc4_45.2 (constants.%ptr.79f)]
  663. // CHECK:STDOUT:
  664. // CHECK:STDOUT: !definition:
  665. // CHECK:STDOUT: %require_complete.loc4_41: <witness> = require_complete_type @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) [symbolic = %require_complete.loc4_41 (constants.%require_complete.6e5)]
  666. // CHECK:STDOUT: %require_complete.loc4_36: <witness> = require_complete_type @ImplicitGenericParam.%T.loc4_25.2 (%T) [symbolic = %require_complete.loc4_36 (constants.%require_complete.4ae)]
  667. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2: <specific function> = specific_function constants.%ImplicitGenericParam, @ImplicitGenericParam(%T.loc4_25.2) [symbolic = %ImplicitGenericParam.specific_fn.loc4_56.2 (constants.%ImplicitGenericParam.specific_fn.fc1)]
  668. // CHECK:STDOUT:
  669. // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @ImplicitGenericParam.%T.loc4_25.2 (%T)) -> @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) {
  670. // CHECK:STDOUT: !entry:
  671. // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [template = constants.%ImplicitGenericParam]
  672. // CHECK:STDOUT: %x.ref: @ImplicitGenericParam.%T.loc4_25.2 (%T) = name_ref x, %x
  673. // 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.fc1)]
  674. // CHECK:STDOUT: %ImplicitGenericParam.call: init @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = call %ImplicitGenericParam.specific_fn.loc4_56.1(%x.ref)
  675. // CHECK:STDOUT: %.loc4_79.1: @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = value_of_initializer %ImplicitGenericParam.call
  676. // CHECK:STDOUT: %.loc4_79.2: @ImplicitGenericParam.%ptr.loc4_45.2 (%ptr.79f) = converted %ImplicitGenericParam.call, %.loc4_79.1
  677. // CHECK:STDOUT: return %.loc4_79.2
  678. // CHECK:STDOUT: }
  679. // CHECK:STDOUT: }
  680. // CHECK:STDOUT:
  681. // CHECK:STDOUT: fn @CallImplicitGenericParam(%n.param_patt: %i32) -> %ptr.235 {
  682. // CHECK:STDOUT: !entry:
  683. // CHECK:STDOUT: %ImplicitGenericParam.ref: %ImplicitGenericParam.type = name_ref ImplicitGenericParam, file.%ImplicitGenericParam.decl [template = constants.%ImplicitGenericParam]
  684. // CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
  685. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn: <specific function> = specific_function %ImplicitGenericParam.ref, @ImplicitGenericParam(constants.%i32) [template = constants.%ImplicitGenericParam.specific_fn.752]
  686. // CHECK:STDOUT: %ImplicitGenericParam.call: init %ptr.235 = call %ImplicitGenericParam.specific_fn(%n.ref)
  687. // CHECK:STDOUT: %.loc7_33.1: %ptr.235 = value_of_initializer %ImplicitGenericParam.call
  688. // CHECK:STDOUT: %.loc7_33.2: %ptr.235 = converted %ImplicitGenericParam.call, %.loc7_33.1
  689. // CHECK:STDOUT: return %.loc7_33.2
  690. // CHECK:STDOUT: }
  691. // CHECK:STDOUT:
  692. // CHECK:STDOUT: specific @ImplicitGenericParam(constants.%T) {
  693. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  694. // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T
  695. // CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.79f
  696. // CHECK:STDOUT:
  697. // CHECK:STDOUT: !definition:
  698. // CHECK:STDOUT: %require_complete.loc4_41 => constants.%require_complete.6e5
  699. // CHECK:STDOUT: %require_complete.loc4_36 => constants.%require_complete.4ae
  700. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.fc1
  701. // CHECK:STDOUT: }
  702. // CHECK:STDOUT:
  703. // CHECK:STDOUT: specific @ImplicitGenericParam(%T.loc4_25.2) {}
  704. // CHECK:STDOUT:
  705. // CHECK:STDOUT: specific @ImplicitGenericParam(constants.%i32) {
  706. // CHECK:STDOUT: %T.loc4_25.2 => constants.%i32
  707. // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%i32
  708. // CHECK:STDOUT: %ptr.loc4_45.2 => constants.%ptr.235
  709. // CHECK:STDOUT:
  710. // CHECK:STDOUT: !definition:
  711. // CHECK:STDOUT: %require_complete.loc4_41 => constants.%complete_type.3d0
  712. // CHECK:STDOUT: %require_complete.loc4_36 => constants.%complete_type.f8a
  713. // CHECK:STDOUT: %ImplicitGenericParam.specific_fn.loc4_56.2 => constants.%ImplicitGenericParam.specific_fn.752
  714. // CHECK:STDOUT: }
  715. // CHECK:STDOUT:
  716. // CHECK:STDOUT: --- deduce_nested_tuple.carbon
  717. // CHECK:STDOUT:
  718. // CHECK:STDOUT: constants {
  719. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  720. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  721. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  722. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  723. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  724. // CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
  725. // CHECK:STDOUT: %tuple.type.f83: type = tuple_type (%T, %i32) [symbolic]
  726. // CHECK:STDOUT: %TupleParam.type: type = fn_type @TupleParam [template]
  727. // CHECK:STDOUT: %TupleParam: %TupleParam.type = struct_value () [template]
  728. // CHECK:STDOUT: %require_complete.9c1: <witness> = require_complete_type %tuple.type.f83 [symbolic]
  729. // CHECK:STDOUT: %CallTupleParam.type: type = fn_type @CallTupleParam [template]
  730. // CHECK:STDOUT: %CallTupleParam: %CallTupleParam.type = struct_value () [template]
  731. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
  732. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  733. // CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
  734. // CHECK:STDOUT: %tuple.type.4c8: type = tuple_type (Core.IntLiteral, %i32) [template]
  735. // CHECK:STDOUT: %TupleParam.specific_fn: <specific function> = specific_function %TupleParam, @TupleParam(Core.IntLiteral) [template]
  736. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  737. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  738. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
  739. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  740. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
  741. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
  742. // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
  743. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
  744. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
  745. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
  746. // CHECK:STDOUT: %tuple: %tuple.type.4c8 = tuple_value (%int_1, %int_2.ef8) [template]
  747. // CHECK:STDOUT: %complete_type.c49: <witness> = complete_type_witness %tuple.type.4c8 [template]
  748. // CHECK:STDOUT: }
  749. // CHECK:STDOUT:
  750. // CHECK:STDOUT: imports {
  751. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  752. // CHECK:STDOUT: .Int = %Core.Int
  753. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  754. // CHECK:STDOUT: import Core//prelude
  755. // CHECK:STDOUT: import Core//prelude/...
  756. // CHECK:STDOUT: }
  757. // CHECK:STDOUT: }
  758. // CHECK:STDOUT:
  759. // CHECK:STDOUT: file {
  760. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  761. // CHECK:STDOUT: .Core = imports.%Core
  762. // CHECK:STDOUT: .TupleParam = %TupleParam.decl
  763. // CHECK:STDOUT: .CallTupleParam = %CallTupleParam.decl
  764. // CHECK:STDOUT: }
  765. // CHECK:STDOUT: %Core.import = import Core
  766. // CHECK:STDOUT: %TupleParam.decl: %TupleParam.type = fn_decl @TupleParam [template = constants.%TupleParam] {
  767. // CHECK:STDOUT: %T.patt.loc4_15.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)]
  768. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_15.1, runtime_param<none> [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)]
  769. // CHECK:STDOUT: %x.patt: @TupleParam.%tuple.type (%tuple.type.f83) = binding_pattern x
  770. // CHECK:STDOUT: %x.param_patt: @TupleParam.%tuple.type (%tuple.type.f83) = value_param_pattern %x.patt, runtime_param0
  771. // CHECK:STDOUT: } {
  772. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  773. // CHECK:STDOUT: %T.loc4_15.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_15.2 (constants.%T)]
  774. // CHECK:STDOUT: %x.param: @TupleParam.%tuple.type (%tuple.type.f83) = value_param runtime_param0
  775. // CHECK:STDOUT: %.loc4_35.1: type = splice_block %.loc4_35.3 [symbolic = %tuple.type (constants.%tuple.type.f83)] {
  776. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.1 [symbolic = %T.loc4_15.2 (constants.%T)]
  777. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  778. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  779. // CHECK:STDOUT: %.loc4_35.2: %tuple.type.24b = tuple_literal (%T.ref, %i32)
  780. // CHECK:STDOUT: %.loc4_35.3: type = converted %.loc4_35.2, constants.%tuple.type.f83 [symbolic = %tuple.type (constants.%tuple.type.f83)]
  781. // CHECK:STDOUT: }
  782. // CHECK:STDOUT: %x: @TupleParam.%tuple.type (%tuple.type.f83) = bind_name x, %x.param
  783. // CHECK:STDOUT: }
  784. // CHECK:STDOUT: %CallTupleParam.decl: %CallTupleParam.type = fn_decl @CallTupleParam [template = constants.%CallTupleParam] {} {}
  785. // CHECK:STDOUT: }
  786. // CHECK:STDOUT:
  787. // CHECK:STDOUT: generic fn @TupleParam(%T.loc4_15.1: type) {
  788. // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_15.2 (constants.%T)]
  789. // CHECK:STDOUT: %T.patt.loc4_15.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_15.2 (constants.%T.patt)]
  790. // CHECK:STDOUT: %tuple.type: type = tuple_type (@TupleParam.%T.loc4_15.2 (%T), %i32) [symbolic = %tuple.type (constants.%tuple.type.f83)]
  791. // CHECK:STDOUT:
  792. // CHECK:STDOUT: !definition:
  793. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @TupleParam.%tuple.type (%tuple.type.f83) [symbolic = %require_complete (constants.%require_complete.9c1)]
  794. // CHECK:STDOUT:
  795. // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @TupleParam.%tuple.type (%tuple.type.f83)) {
  796. // CHECK:STDOUT: !entry:
  797. // CHECK:STDOUT: return
  798. // CHECK:STDOUT: }
  799. // CHECK:STDOUT: }
  800. // CHECK:STDOUT:
  801. // CHECK:STDOUT: fn @CallTupleParam() {
  802. // CHECK:STDOUT: !entry:
  803. // CHECK:STDOUT: %TupleParam.ref: %TupleParam.type = name_ref TupleParam, file.%TupleParam.decl [template = constants.%TupleParam]
  804. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
  805. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  806. // CHECK:STDOUT: %.loc7_19.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2)
  807. // CHECK:STDOUT: %TupleParam.specific_fn: <specific function> = specific_function %TupleParam.ref, @TupleParam(Core.IntLiteral) [template = constants.%TupleParam.specific_fn]
  808. // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  809. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound]
  810. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
  811. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8]
  812. // CHECK:STDOUT: %.loc7_19.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8]
  813. // CHECK:STDOUT: %.loc7_19.3: %i32 = converted %int_2, %.loc7_19.2 [template = constants.%int_2.ef8]
  814. // CHECK:STDOUT: %tuple: %tuple.type.4c8 = tuple_value (%int_1, %.loc7_19.3) [template = constants.%tuple]
  815. // CHECK:STDOUT: %.loc7_19.4: %tuple.type.4c8 = converted %.loc7_19.1, %tuple [template = constants.%tuple]
  816. // CHECK:STDOUT: %TupleParam.call: init %empty_tuple.type = call %TupleParam.specific_fn(%.loc7_19.4)
  817. // CHECK:STDOUT: return
  818. // CHECK:STDOUT: }
  819. // CHECK:STDOUT:
  820. // CHECK:STDOUT: specific @TupleParam(constants.%T) {
  821. // CHECK:STDOUT: %T.loc4_15.2 => constants.%T
  822. // CHECK:STDOUT: %T.patt.loc4_15.2 => constants.%T
  823. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.f83
  824. // CHECK:STDOUT: }
  825. // CHECK:STDOUT:
  826. // CHECK:STDOUT: specific @TupleParam(Core.IntLiteral) {
  827. // CHECK:STDOUT: %T.loc4_15.2 => Core.IntLiteral
  828. // CHECK:STDOUT: %T.patt.loc4_15.2 => Core.IntLiteral
  829. // CHECK:STDOUT: %tuple.type => constants.%tuple.type.4c8
  830. // CHECK:STDOUT:
  831. // CHECK:STDOUT: !definition:
  832. // CHECK:STDOUT: %require_complete => constants.%complete_type.c49
  833. // CHECK:STDOUT: }
  834. // CHECK:STDOUT:
  835. // CHECK:STDOUT: --- deduce_nested_struct.carbon
  836. // CHECK:STDOUT:
  837. // CHECK:STDOUT: constants {
  838. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  839. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  840. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  841. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  842. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  843. // CHECK:STDOUT: %struct_type.a.b.46e: type = struct_type {.a: %T, .b: %i32} [symbolic]
  844. // CHECK:STDOUT: %StructParam.type: type = fn_type @StructParam [template]
  845. // CHECK:STDOUT: %StructParam: %StructParam.type = struct_value () [template]
  846. // CHECK:STDOUT: %require_complete.23a: <witness> = require_complete_type %struct_type.a.b.46e [symbolic]
  847. // CHECK:STDOUT: %CallStructParam.type: type = fn_type @CallStructParam [template]
  848. // CHECK:STDOUT: %CallStructParam: %CallStructParam.type = struct_value () [template]
  849. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
  850. // CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
  851. // CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template]
  852. // CHECK:STDOUT: %struct_type.a.b.a13: type = struct_type {.a: Core.IntLiteral, .b: %i32} [template]
  853. // CHECK:STDOUT: %StructParam.specific_fn: <specific function> = specific_function %StructParam, @StructParam(Core.IntLiteral) [template]
  854. // CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
  855. // CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
  856. // CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
  857. // CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
  858. // CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
  859. // CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
  860. // CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
  861. // CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
  862. // CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
  863. // CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
  864. // CHECK:STDOUT: %struct: %struct_type.a.b.a13 = struct_value (%int_1, %int_2.ef8) [template]
  865. // CHECK:STDOUT: %complete_type.a4a: <witness> = complete_type_witness %struct_type.a.b.a13 [template]
  866. // CHECK:STDOUT: }
  867. // CHECK:STDOUT:
  868. // CHECK:STDOUT: imports {
  869. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  870. // CHECK:STDOUT: .Int = %Core.Int
  871. // CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
  872. // CHECK:STDOUT: import Core//prelude
  873. // CHECK:STDOUT: import Core//prelude/...
  874. // CHECK:STDOUT: }
  875. // CHECK:STDOUT: }
  876. // CHECK:STDOUT:
  877. // CHECK:STDOUT: file {
  878. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  879. // CHECK:STDOUT: .Core = imports.%Core
  880. // CHECK:STDOUT: .StructParam = %StructParam.decl
  881. // CHECK:STDOUT: .CallStructParam = %CallStructParam.decl
  882. // CHECK:STDOUT: }
  883. // CHECK:STDOUT: %Core.import = import Core
  884. // CHECK:STDOUT: %StructParam.decl: %StructParam.type = fn_decl @StructParam [template = constants.%StructParam] {
  885. // CHECK:STDOUT: %T.patt.loc4_16.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)]
  886. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_16.1, runtime_param<none> [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)]
  887. // CHECK:STDOUT: %x.patt: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e) = binding_pattern x
  888. // CHECK:STDOUT: %x.param_patt: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e) = value_param_pattern %x.patt, runtime_param0
  889. // CHECK:STDOUT: } {
  890. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  891. // CHECK:STDOUT: %T.loc4_16.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_16.2 (constants.%T)]
  892. // CHECK:STDOUT: %x.param: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e) = value_param runtime_param0
  893. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.a.b.loc4_44.1 [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.46e)] {
  894. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.1 [symbolic = %T.loc4_16.2 (constants.%T)]
  895. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  896. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  897. // CHECK:STDOUT: %struct_type.a.b.loc4_44.1: type = struct_type {.a: %T, .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.46e)]
  898. // CHECK:STDOUT: }
  899. // CHECK:STDOUT: %x: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e) = bind_name x, %x.param
  900. // CHECK:STDOUT: }
  901. // CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [template = constants.%CallStructParam] {} {}
  902. // CHECK:STDOUT: }
  903. // CHECK:STDOUT:
  904. // CHECK:STDOUT: generic fn @StructParam(%T.loc4_16.1: type) {
  905. // CHECK:STDOUT: %T.loc4_16.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_16.2 (constants.%T)]
  906. // CHECK:STDOUT: %T.patt.loc4_16.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_16.2 (constants.%T.patt)]
  907. // CHECK:STDOUT: %struct_type.a.b.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.2 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.2 (constants.%struct_type.a.b.46e)]
  908. // CHECK:STDOUT:
  909. // CHECK:STDOUT: !definition:
  910. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e) [symbolic = %require_complete (constants.%require_complete.23a)]
  911. // CHECK:STDOUT:
  912. // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @StructParam.%struct_type.a.b.loc4_44.2 (%struct_type.a.b.46e)) {
  913. // CHECK:STDOUT: !entry:
  914. // CHECK:STDOUT: return
  915. // CHECK:STDOUT: }
  916. // CHECK:STDOUT: }
  917. // CHECK:STDOUT:
  918. // CHECK:STDOUT: fn @CallStructParam() {
  919. // CHECK:STDOUT: !entry:
  920. // CHECK:STDOUT: %StructParam.ref: %StructParam.type = name_ref StructParam, file.%StructParam.decl [template = constants.%StructParam]
  921. // CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
  922. // CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
  923. // CHECK:STDOUT: %.loc7_30.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2)
  924. // CHECK:STDOUT: %StructParam.specific_fn: <specific function> = specific_function %StructParam.ref, @StructParam(Core.IntLiteral) [template = constants.%StructParam.specific_fn]
  925. // CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
  926. // CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_2, %impl.elem0 [template = constants.%Convert.bound]
  927. // CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
  928. // CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_2) [template = constants.%int_2.ef8]
  929. // CHECK:STDOUT: %.loc7_30.2: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_2.ef8]
  930. // CHECK:STDOUT: %.loc7_30.3: %i32 = converted %int_2, %.loc7_30.2 [template = constants.%int_2.ef8]
  931. // CHECK:STDOUT: %struct: %struct_type.a.b.a13 = struct_value (%int_1, %.loc7_30.3) [template = constants.%struct]
  932. // CHECK:STDOUT: %.loc7_30.4: %struct_type.a.b.a13 = converted %.loc7_30.1, %struct [template = constants.%struct]
  933. // CHECK:STDOUT: %StructParam.call: init %empty_tuple.type = call %StructParam.specific_fn(%.loc7_30.4)
  934. // CHECK:STDOUT: return
  935. // CHECK:STDOUT: }
  936. // CHECK:STDOUT:
  937. // CHECK:STDOUT: specific @StructParam(constants.%T) {
  938. // CHECK:STDOUT: %T.loc4_16.2 => constants.%T
  939. // CHECK:STDOUT: %T.patt.loc4_16.2 => constants.%T
  940. // CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.46e
  941. // CHECK:STDOUT: }
  942. // CHECK:STDOUT:
  943. // CHECK:STDOUT: specific @StructParam(Core.IntLiteral) {
  944. // CHECK:STDOUT: %T.loc4_16.2 => Core.IntLiteral
  945. // CHECK:STDOUT: %T.patt.loc4_16.2 => Core.IntLiteral
  946. // CHECK:STDOUT: %struct_type.a.b.loc4_44.2 => constants.%struct_type.a.b.a13
  947. // CHECK:STDOUT:
  948. // CHECK:STDOUT: !definition:
  949. // CHECK:STDOUT: %require_complete => constants.%complete_type.a4a
  950. // CHECK:STDOUT: }
  951. // CHECK:STDOUT:
  952. // CHECK:STDOUT: --- fail_deduce_bigger_struct.carbon
  953. // CHECK:STDOUT:
  954. // CHECK:STDOUT: constants {
  955. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  956. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  957. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  958. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  959. // CHECK:STDOUT: %struct_type.c.d.e: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic]
  960. // CHECK:STDOUT: %BigStructParam.type: type = fn_type @BigStructParam [template]
  961. // CHECK:STDOUT: %BigStructParam: %BigStructParam.type = struct_value () [template]
  962. // CHECK:STDOUT: %require_complete.694: <witness> = require_complete_type %struct_type.c.d.e [symbolic]
  963. // CHECK:STDOUT: %CallBigStructParam.type: type = fn_type @CallBigStructParam [template]
  964. // CHECK:STDOUT: %CallBigStructParam: %CallBigStructParam.type = struct_value () [template]
  965. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template]
  966. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template]
  967. // CHECK:STDOUT: %struct_type.c.d: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [template]
  968. // CHECK:STDOUT: }
  969. // CHECK:STDOUT:
  970. // CHECK:STDOUT: imports {
  971. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  972. // CHECK:STDOUT: .Int = %Core.Int
  973. // CHECK:STDOUT: import Core//prelude
  974. // CHECK:STDOUT: import Core//prelude/...
  975. // CHECK:STDOUT: }
  976. // CHECK:STDOUT: }
  977. // CHECK:STDOUT:
  978. // CHECK:STDOUT: file {
  979. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  980. // CHECK:STDOUT: .Core = imports.%Core
  981. // CHECK:STDOUT: .BigStructParam = %BigStructParam.decl
  982. // CHECK:STDOUT: .CallBigStructParam = %CallBigStructParam.decl
  983. // CHECK:STDOUT: }
  984. // CHECK:STDOUT: %Core.import = import Core
  985. // CHECK:STDOUT: %BigStructParam.decl: %BigStructParam.type = fn_decl @BigStructParam [template = constants.%BigStructParam] {
  986. // CHECK:STDOUT: %T.patt.loc4_19.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)]
  987. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_19.1, runtime_param<none> [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)]
  988. // CHECK:STDOUT: %x.patt: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = binding_pattern x
  989. // CHECK:STDOUT: %x.param_patt: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = value_param_pattern %x.patt, runtime_param0
  990. // CHECK:STDOUT: } {
  991. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  992. // CHECK:STDOUT: %T.loc4_19.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_19.2 (constants.%T)]
  993. // CHECK:STDOUT: %x.param: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = value_param runtime_param0
  994. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.c.d.e.loc4_56.1 [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)] {
  995. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_19.1 [symbolic = %T.loc4_19.2 (constants.%T)]
  996. // CHECK:STDOUT: %int_32.loc4_44: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  997. // CHECK:STDOUT: %i32.loc4_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  998. // CHECK:STDOUT: %int_32.loc4_53: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  999. // CHECK:STDOUT: %i32.loc4_53: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  1000. // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1: type = struct_type {.c: %T, .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)]
  1001. // CHECK:STDOUT: }
  1002. // CHECK:STDOUT: %x: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) = bind_name x, %x.param
  1003. // CHECK:STDOUT: }
  1004. // CHECK:STDOUT: %CallBigStructParam.decl: %CallBigStructParam.type = fn_decl @CallBigStructParam [template = constants.%CallBigStructParam] {} {}
  1005. // CHECK:STDOUT: }
  1006. // CHECK:STDOUT:
  1007. // CHECK:STDOUT: generic fn @BigStructParam(%T.loc4_19.1: type) {
  1008. // CHECK:STDOUT: %T.loc4_19.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_19.2 (constants.%T)]
  1009. // CHECK:STDOUT: %T.patt.loc4_19.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_19.2 (constants.%T.patt)]
  1010. // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.2 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.2 (constants.%struct_type.c.d.e)]
  1011. // CHECK:STDOUT:
  1012. // CHECK:STDOUT: !definition:
  1013. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e) [symbolic = %require_complete (constants.%require_complete.694)]
  1014. // CHECK:STDOUT:
  1015. // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @BigStructParam.%struct_type.c.d.e.loc4_56.2 (%struct_type.c.d.e)) {
  1016. // CHECK:STDOUT: !entry:
  1017. // CHECK:STDOUT: return
  1018. // CHECK:STDOUT: }
  1019. // CHECK:STDOUT: }
  1020. // CHECK:STDOUT:
  1021. // CHECK:STDOUT: fn @CallBigStructParam() {
  1022. // CHECK:STDOUT: !entry:
  1023. // CHECK:STDOUT: %BigStructParam.ref: %BigStructParam.type = name_ref BigStructParam, file.%BigStructParam.decl [template = constants.%BigStructParam]
  1024. // CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3]
  1025. // CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4]
  1026. // CHECK:STDOUT: %.loc14: %struct_type.c.d = struct_literal (%int_3, %int_4)
  1027. // CHECK:STDOUT: return
  1028. // CHECK:STDOUT: }
  1029. // CHECK:STDOUT:
  1030. // CHECK:STDOUT: specific @BigStructParam(constants.%T) {
  1031. // CHECK:STDOUT: %T.loc4_19.2 => constants.%T
  1032. // CHECK:STDOUT: %T.patt.loc4_19.2 => constants.%T
  1033. // CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2 => constants.%struct_type.c.d.e
  1034. // CHECK:STDOUT: }
  1035. // CHECK:STDOUT:
  1036. // CHECK:STDOUT: --- fail_deduce_smaller_struct.carbon
  1037. // CHECK:STDOUT:
  1038. // CHECK:STDOUT: constants {
  1039. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1040. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1041. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  1042. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  1043. // CHECK:STDOUT: %struct_type.f.g: type = struct_type {.f: %T, .g: %i32} [symbolic]
  1044. // CHECK:STDOUT: %SmallStructParam.type: type = fn_type @SmallStructParam [template]
  1045. // CHECK:STDOUT: %SmallStructParam: %SmallStructParam.type = struct_value () [template]
  1046. // CHECK:STDOUT: %require_complete.dad: <witness> = require_complete_type %struct_type.f.g [symbolic]
  1047. // CHECK:STDOUT: %CallSmallStructParam.type: type = fn_type @CallSmallStructParam [template]
  1048. // CHECK:STDOUT: %CallSmallStructParam: %CallSmallStructParam.type = struct_value () [template]
  1049. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template]
  1050. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template]
  1051. // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template]
  1052. // CHECK:STDOUT: %struct_type.f.g.h: type = struct_type {.f: Core.IntLiteral, .g: Core.IntLiteral, .h: Core.IntLiteral} [template]
  1053. // CHECK:STDOUT: }
  1054. // CHECK:STDOUT:
  1055. // CHECK:STDOUT: imports {
  1056. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1057. // CHECK:STDOUT: .Int = %Core.Int
  1058. // CHECK:STDOUT: import Core//prelude
  1059. // CHECK:STDOUT: import Core//prelude/...
  1060. // CHECK:STDOUT: }
  1061. // CHECK:STDOUT: }
  1062. // CHECK:STDOUT:
  1063. // CHECK:STDOUT: file {
  1064. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1065. // CHECK:STDOUT: .Core = imports.%Core
  1066. // CHECK:STDOUT: .SmallStructParam = %SmallStructParam.decl
  1067. // CHECK:STDOUT: .CallSmallStructParam = %CallSmallStructParam.decl
  1068. // CHECK:STDOUT: }
  1069. // CHECK:STDOUT: %Core.import = import Core
  1070. // CHECK:STDOUT: %SmallStructParam.decl: %SmallStructParam.type = fn_decl @SmallStructParam [template = constants.%SmallStructParam] {
  1071. // CHECK:STDOUT: %T.patt.loc4_21.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)]
  1072. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_21.1, runtime_param<none> [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)]
  1073. // CHECK:STDOUT: %x.patt: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = binding_pattern x
  1074. // CHECK:STDOUT: %x.param_patt: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = value_param_pattern %x.patt, runtime_param0
  1075. // CHECK:STDOUT: } {
  1076. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  1077. // CHECK:STDOUT: %T.loc4_21.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_21.2 (constants.%T)]
  1078. // CHECK:STDOUT: %x.param: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = value_param runtime_param0
  1079. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.f.g.loc4_49.1 [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)] {
  1080. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.1 [symbolic = %T.loc4_21.2 (constants.%T)]
  1081. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  1082. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  1083. // CHECK:STDOUT: %struct_type.f.g.loc4_49.1: type = struct_type {.f: %T, .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)]
  1084. // CHECK:STDOUT: }
  1085. // CHECK:STDOUT: %x: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) = bind_name x, %x.param
  1086. // CHECK:STDOUT: }
  1087. // CHECK:STDOUT: %CallSmallStructParam.decl: %CallSmallStructParam.type = fn_decl @CallSmallStructParam [template = constants.%CallSmallStructParam] {} {}
  1088. // CHECK:STDOUT: }
  1089. // CHECK:STDOUT:
  1090. // CHECK:STDOUT: generic fn @SmallStructParam(%T.loc4_21.1: type) {
  1091. // CHECK:STDOUT: %T.loc4_21.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_21.2 (constants.%T)]
  1092. // CHECK:STDOUT: %T.patt.loc4_21.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_21.2 (constants.%T.patt)]
  1093. // CHECK:STDOUT: %struct_type.f.g.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.2 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.2 (constants.%struct_type.f.g)]
  1094. // CHECK:STDOUT:
  1095. // CHECK:STDOUT: !definition:
  1096. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g) [symbolic = %require_complete (constants.%require_complete.dad)]
  1097. // CHECK:STDOUT:
  1098. // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @SmallStructParam.%struct_type.f.g.loc4_49.2 (%struct_type.f.g)) {
  1099. // CHECK:STDOUT: !entry:
  1100. // CHECK:STDOUT: return
  1101. // CHECK:STDOUT: }
  1102. // CHECK:STDOUT: }
  1103. // CHECK:STDOUT:
  1104. // CHECK:STDOUT: fn @CallSmallStructParam() {
  1105. // CHECK:STDOUT: !entry:
  1106. // CHECK:STDOUT: %SmallStructParam.ref: %SmallStructParam.type = name_ref SmallStructParam, file.%SmallStructParam.decl [template = constants.%SmallStructParam]
  1107. // CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5]
  1108. // CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [template = constants.%int_6]
  1109. // CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7]
  1110. // CHECK:STDOUT: %.loc14: %struct_type.f.g.h = struct_literal (%int_5, %int_6, %int_7)
  1111. // CHECK:STDOUT: return
  1112. // CHECK:STDOUT: }
  1113. // CHECK:STDOUT:
  1114. // CHECK:STDOUT: specific @SmallStructParam(constants.%T) {
  1115. // CHECK:STDOUT: %T.loc4_21.2 => constants.%T
  1116. // CHECK:STDOUT: %T.patt.loc4_21.2 => constants.%T
  1117. // CHECK:STDOUT: %struct_type.f.g.loc4_49.2 => constants.%struct_type.f.g
  1118. // CHECK:STDOUT: }
  1119. // CHECK:STDOUT:
  1120. // CHECK:STDOUT: --- fail_deduce_struct_wrong_name.carbon
  1121. // CHECK:STDOUT:
  1122. // CHECK:STDOUT: constants {
  1123. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1124. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1125. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  1126. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  1127. // CHECK:STDOUT: %struct_type.i.different: type = struct_type {.i: %T, .different: %i32} [symbolic]
  1128. // CHECK:STDOUT: %WrongNameStructParam.type: type = fn_type @WrongNameStructParam [template]
  1129. // CHECK:STDOUT: %WrongNameStructParam: %WrongNameStructParam.type = struct_value () [template]
  1130. // CHECK:STDOUT: %require_complete.411: <witness> = require_complete_type %struct_type.i.different [symbolic]
  1131. // CHECK:STDOUT: %CallWrongNameStructParam.type: type = fn_type @CallWrongNameStructParam [template]
  1132. // CHECK:STDOUT: %CallWrongNameStructParam: %CallWrongNameStructParam.type = struct_value () [template]
  1133. // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template]
  1134. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template]
  1135. // CHECK:STDOUT: %struct_type.i.j: type = struct_type {.i: Core.IntLiteral, .j: Core.IntLiteral} [template]
  1136. // CHECK:STDOUT: }
  1137. // CHECK:STDOUT:
  1138. // CHECK:STDOUT: imports {
  1139. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1140. // CHECK:STDOUT: .Int = %Core.Int
  1141. // CHECK:STDOUT: import Core//prelude
  1142. // CHECK:STDOUT: import Core//prelude/...
  1143. // CHECK:STDOUT: }
  1144. // CHECK:STDOUT: }
  1145. // CHECK:STDOUT:
  1146. // CHECK:STDOUT: file {
  1147. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1148. // CHECK:STDOUT: .Core = imports.%Core
  1149. // CHECK:STDOUT: .WrongNameStructParam = %WrongNameStructParam.decl
  1150. // CHECK:STDOUT: .CallWrongNameStructParam = %CallWrongNameStructParam.decl
  1151. // CHECK:STDOUT: }
  1152. // CHECK:STDOUT: %Core.import = import Core
  1153. // CHECK:STDOUT: %WrongNameStructParam.decl: %WrongNameStructParam.type = fn_decl @WrongNameStructParam [template = constants.%WrongNameStructParam] {
  1154. // CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  1155. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_25.1, runtime_param<none> [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  1156. // CHECK:STDOUT: %x.patt: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = binding_pattern x
  1157. // CHECK:STDOUT: %x.param_patt: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = value_param_pattern %x.patt, runtime_param0
  1158. // CHECK:STDOUT: } {
  1159. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  1160. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)]
  1161. // CHECK:STDOUT: %x.param: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = value_param runtime_param0
  1162. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.i.different.loc4_61.1 [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)] {
  1163. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  1164. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  1165. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  1166. // CHECK:STDOUT: %struct_type.i.different.loc4_61.1: type = struct_type {.i: %T, .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)]
  1167. // CHECK:STDOUT: }
  1168. // CHECK:STDOUT: %x: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) = bind_name x, %x.param
  1169. // CHECK:STDOUT: }
  1170. // CHECK:STDOUT: %CallWrongNameStructParam.decl: %CallWrongNameStructParam.type = fn_decl @CallWrongNameStructParam [template = constants.%CallWrongNameStructParam] {} {}
  1171. // CHECK:STDOUT: }
  1172. // CHECK:STDOUT:
  1173. // CHECK:STDOUT: generic fn @WrongNameStructParam(%T.loc4_25.1: type) {
  1174. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  1175. // CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  1176. // CHECK:STDOUT: %struct_type.i.different.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.2 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.2 (constants.%struct_type.i.different)]
  1177. // CHECK:STDOUT:
  1178. // CHECK:STDOUT: !definition:
  1179. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different) [symbolic = %require_complete (constants.%require_complete.411)]
  1180. // CHECK:STDOUT:
  1181. // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongNameStructParam.%struct_type.i.different.loc4_61.2 (%struct_type.i.different)) {
  1182. // CHECK:STDOUT: !entry:
  1183. // CHECK:STDOUT: return
  1184. // CHECK:STDOUT: }
  1185. // CHECK:STDOUT: }
  1186. // CHECK:STDOUT:
  1187. // CHECK:STDOUT: fn @CallWrongNameStructParam() {
  1188. // CHECK:STDOUT: !entry:
  1189. // CHECK:STDOUT: %WrongNameStructParam.ref: %WrongNameStructParam.type = name_ref WrongNameStructParam, file.%WrongNameStructParam.decl [template = constants.%WrongNameStructParam]
  1190. // CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [template = constants.%int_8]
  1191. // CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [template = constants.%int_9]
  1192. // CHECK:STDOUT: %.loc14: %struct_type.i.j = struct_literal (%int_8, %int_9)
  1193. // CHECK:STDOUT: return
  1194. // CHECK:STDOUT: }
  1195. // CHECK:STDOUT:
  1196. // CHECK:STDOUT: specific @WrongNameStructParam(constants.%T) {
  1197. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  1198. // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T
  1199. // CHECK:STDOUT: %struct_type.i.different.loc4_61.2 => constants.%struct_type.i.different
  1200. // CHECK:STDOUT: }
  1201. // CHECK:STDOUT:
  1202. // CHECK:STDOUT: --- fail_todo_deduce_struct_wrong_order.carbon
  1203. // CHECK:STDOUT:
  1204. // CHECK:STDOUT: constants {
  1205. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1206. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1207. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
  1208. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
  1209. // CHECK:STDOUT: %struct_type.first.second: type = struct_type {.first: %T, .second: %i32} [symbolic]
  1210. // CHECK:STDOUT: %WrongOrderStructParam.type: type = fn_type @WrongOrderStructParam [template]
  1211. // CHECK:STDOUT: %WrongOrderStructParam: %WrongOrderStructParam.type = struct_value () [template]
  1212. // CHECK:STDOUT: %require_complete.d6e: <witness> = require_complete_type %struct_type.first.second [symbolic]
  1213. // CHECK:STDOUT: %CallWrongOrderStructParam.type: type = fn_type @CallWrongOrderStructParam [template]
  1214. // CHECK:STDOUT: %CallWrongOrderStructParam: %CallWrongOrderStructParam.type = struct_value () [template]
  1215. // CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [template]
  1216. // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template]
  1217. // CHECK:STDOUT: %struct_type.second.first: type = struct_type {.second: Core.IntLiteral, .first: Core.IntLiteral} [template]
  1218. // CHECK:STDOUT: }
  1219. // CHECK:STDOUT:
  1220. // CHECK:STDOUT: imports {
  1221. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1222. // CHECK:STDOUT: .Int = %Core.Int
  1223. // CHECK:STDOUT: import Core//prelude
  1224. // CHECK:STDOUT: import Core//prelude/...
  1225. // CHECK:STDOUT: }
  1226. // CHECK:STDOUT: }
  1227. // CHECK:STDOUT:
  1228. // CHECK:STDOUT: file {
  1229. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1230. // CHECK:STDOUT: .Core = imports.%Core
  1231. // CHECK:STDOUT: .WrongOrderStructParam = %WrongOrderStructParam.decl
  1232. // CHECK:STDOUT: .CallWrongOrderStructParam = %CallWrongOrderStructParam.decl
  1233. // CHECK:STDOUT: }
  1234. // CHECK:STDOUT: %Core.import = import Core
  1235. // CHECK:STDOUT: %WrongOrderStructParam.decl: %WrongOrderStructParam.type = fn_decl @WrongOrderStructParam [template = constants.%WrongOrderStructParam] {
  1236. // CHECK:STDOUT: %T.patt.loc4_26.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_26.2 (constants.%T.patt)]
  1237. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_26.1, runtime_param<none> [symbolic = %T.patt.loc4_26.2 (constants.%T.patt)]
  1238. // CHECK:STDOUT: %x.patt: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = binding_pattern x
  1239. // CHECK:STDOUT: %x.param_patt: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = value_param_pattern %x.patt, runtime_param0
  1240. // CHECK:STDOUT: } {
  1241. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  1242. // CHECK:STDOUT: %T.loc4_26.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_26.2 (constants.%T)]
  1243. // CHECK:STDOUT: %x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = value_param runtime_param0
  1244. // CHECK:STDOUT: %.loc4: type = splice_block %struct_type.first.second.loc4_63.1 [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)] {
  1245. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.1 [symbolic = %T.loc4_26.2 (constants.%T)]
  1246. // CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
  1247. // CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
  1248. // CHECK:STDOUT: %struct_type.first.second.loc4_63.1: type = struct_type {.first: %T, .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)]
  1249. // CHECK:STDOUT: }
  1250. // CHECK:STDOUT: %x: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) = bind_name x, %x.param
  1251. // CHECK:STDOUT: }
  1252. // CHECK:STDOUT: %CallWrongOrderStructParam.decl: %CallWrongOrderStructParam.type = fn_decl @CallWrongOrderStructParam [template = constants.%CallWrongOrderStructParam] {} {}
  1253. // CHECK:STDOUT: }
  1254. // CHECK:STDOUT:
  1255. // CHECK:STDOUT: generic fn @WrongOrderStructParam(%T.loc4_26.1: type) {
  1256. // CHECK:STDOUT: %T.loc4_26.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_26.2 (constants.%T)]
  1257. // CHECK:STDOUT: %T.patt.loc4_26.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_26.2 (constants.%T.patt)]
  1258. // CHECK:STDOUT: %struct_type.first.second.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.2 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.2 (constants.%struct_type.first.second)]
  1259. // CHECK:STDOUT:
  1260. // CHECK:STDOUT: !definition:
  1261. // CHECK:STDOUT: %require_complete: <witness> = require_complete_type @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second) [symbolic = %require_complete (constants.%require_complete.d6e)]
  1262. // CHECK:STDOUT:
  1263. // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @WrongOrderStructParam.%struct_type.first.second.loc4_63.2 (%struct_type.first.second)) {
  1264. // CHECK:STDOUT: !entry:
  1265. // CHECK:STDOUT: return
  1266. // CHECK:STDOUT: }
  1267. // CHECK:STDOUT: }
  1268. // CHECK:STDOUT:
  1269. // CHECK:STDOUT: fn @CallWrongOrderStructParam() {
  1270. // CHECK:STDOUT: !entry:
  1271. // CHECK:STDOUT: %WrongOrderStructParam.ref: %WrongOrderStructParam.type = name_ref WrongOrderStructParam, file.%WrongOrderStructParam.decl [template = constants.%WrongOrderStructParam]
  1272. // CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [template = constants.%int_11]
  1273. // CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [template = constants.%int_10]
  1274. // CHECK:STDOUT: %.loc14: %struct_type.second.first = struct_literal (%int_11, %int_10)
  1275. // CHECK:STDOUT: return
  1276. // CHECK:STDOUT: }
  1277. // CHECK:STDOUT:
  1278. // CHECK:STDOUT: specific @WrongOrderStructParam(constants.%T) {
  1279. // CHECK:STDOUT: %T.loc4_26.2 => constants.%T
  1280. // CHECK:STDOUT: %T.patt.loc4_26.2 => constants.%T
  1281. // CHECK:STDOUT: %struct_type.first.second.loc4_63.2 => constants.%struct_type.first.second
  1282. // CHECK:STDOUT: }
  1283. // CHECK:STDOUT:
  1284. // CHECK:STDOUT: --- fail_deduce_incomplete.carbon
  1285. // CHECK:STDOUT:
  1286. // CHECK:STDOUT: constants {
  1287. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1288. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1289. // CHECK:STDOUT: %U: type = bind_symbolic_name U, 1 [symbolic]
  1290. // CHECK:STDOUT: %U.patt: type = symbolic_binding_pattern U, 1 [symbolic]
  1291. // CHECK:STDOUT: %ImplicitNotDeducible.type: type = fn_type @ImplicitNotDeducible [template]
  1292. // CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [template]
  1293. // CHECK:STDOUT: %CallImplicitNotDeducible.type: type = fn_type @CallImplicitNotDeducible [template]
  1294. // CHECK:STDOUT: %CallImplicitNotDeducible: %CallImplicitNotDeducible.type = struct_value () [template]
  1295. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template]
  1296. // CHECK:STDOUT: }
  1297. // CHECK:STDOUT:
  1298. // CHECK:STDOUT: imports {
  1299. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1300. // CHECK:STDOUT: import Core//prelude
  1301. // CHECK:STDOUT: import Core//prelude/...
  1302. // CHECK:STDOUT: }
  1303. // CHECK:STDOUT: }
  1304. // CHECK:STDOUT:
  1305. // CHECK:STDOUT: file {
  1306. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1307. // CHECK:STDOUT: .Core = imports.%Core
  1308. // CHECK:STDOUT: .ImplicitNotDeducible = %ImplicitNotDeducible.decl
  1309. // CHECK:STDOUT: .CallImplicitNotDeducible = %CallImplicitNotDeducible.decl
  1310. // CHECK:STDOUT: }
  1311. // CHECK:STDOUT: %Core.import = import Core
  1312. // CHECK:STDOUT: %ImplicitNotDeducible.decl: %ImplicitNotDeducible.type = fn_decl @ImplicitNotDeducible [template = constants.%ImplicitNotDeducible] {
  1313. // CHECK:STDOUT: %T.patt.loc6_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_25.2 (constants.%T.patt)]
  1314. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc6_25.1, runtime_param<none> [symbolic = %T.patt.loc6_25.2 (constants.%T.patt)]
  1315. // CHECK:STDOUT: %U.patt.loc6_35.1: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc6_35.2 (constants.%U.patt)]
  1316. // CHECK:STDOUT: %U.param_patt: type = value_param_pattern %U.patt.loc6_35.1, runtime_param<none> [symbolic = %U.patt.loc6_35.2 (constants.%U.patt)]
  1317. // CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = binding_pattern x
  1318. // CHECK:STDOUT: %x.param_patt: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = value_param_pattern %x.patt, runtime_param0
  1319. // CHECK:STDOUT: %return.patt: @ImplicitNotDeducible.%U.loc6_35.2 (%U) = return_slot_pattern
  1320. // CHECK:STDOUT: %return.param_patt: @ImplicitNotDeducible.%U.loc6_35.2 (%U) = out_param_pattern %return.patt, runtime_param1
  1321. // CHECK:STDOUT: } {
  1322. // CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc6_35.1 [symbolic = %U.loc6_35.2 (constants.%U)]
  1323. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  1324. // CHECK:STDOUT: %T.loc6_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc6_25.2 (constants.%T)]
  1325. // CHECK:STDOUT: %U.param: type = value_param runtime_param<none>
  1326. // CHECK:STDOUT: %U.loc6_35.1: type = bind_symbolic_name U, 1, %U.param [symbolic = %U.loc6_35.2 (constants.%U)]
  1327. // CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = value_param runtime_param0
  1328. // CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc6_25.1 [symbolic = %T.loc6_25.2 (constants.%T)]
  1329. // CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc6_25.2 (%T) = bind_name x, %x.param
  1330. // CHECK:STDOUT: %return.param: ref @ImplicitNotDeducible.%U.loc6_35.2 (%U) = out_param runtime_param1
  1331. // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%U.loc6_35.2 (%U) = return_slot %return.param
  1332. // CHECK:STDOUT: }
  1333. // CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [template = constants.%CallImplicitNotDeducible] {} {}
  1334. // CHECK:STDOUT: }
  1335. // CHECK:STDOUT:
  1336. // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc6_25.1: type, %U.loc6_35.1: type) {
  1337. // CHECK:STDOUT: %T.loc6_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc6_25.2 (constants.%T)]
  1338. // CHECK:STDOUT: %T.patt.loc6_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc6_25.2 (constants.%T.patt)]
  1339. // CHECK:STDOUT: %U.loc6_35.2: type = bind_symbolic_name U, 1 [symbolic = %U.loc6_35.2 (constants.%U)]
  1340. // CHECK:STDOUT: %U.patt.loc6_35.2: type = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc6_35.2 (constants.%U.patt)]
  1341. // CHECK:STDOUT:
  1342. // CHECK:STDOUT: fn[%T.param_patt: type, %U.param_patt: type](%x.param_patt: @ImplicitNotDeducible.%T.loc6_25.2 (%T)) -> @ImplicitNotDeducible.%U.loc6_35.2 (%U);
  1343. // CHECK:STDOUT: }
  1344. // CHECK:STDOUT:
  1345. // CHECK:STDOUT: fn @CallImplicitNotDeducible() {
  1346. // CHECK:STDOUT: !entry:
  1347. // CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [template = constants.%ImplicitNotDeducible]
  1348. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42]
  1349. // CHECK:STDOUT: return
  1350. // CHECK:STDOUT: }
  1351. // CHECK:STDOUT:
  1352. // CHECK:STDOUT: specific @ImplicitNotDeducible(constants.%T, constants.%U) {
  1353. // CHECK:STDOUT: %T.loc6_25.2 => constants.%T
  1354. // CHECK:STDOUT: %T.patt.loc6_25.2 => constants.%T
  1355. // CHECK:STDOUT: %U.loc6_35.2 => constants.%U
  1356. // CHECK:STDOUT: %U.patt.loc6_35.2 => constants.%U
  1357. // CHECK:STDOUT: }
  1358. // CHECK:STDOUT:
  1359. // CHECK:STDOUT: --- fail_deduce_inconsistent.carbon
  1360. // CHECK:STDOUT:
  1361. // CHECK:STDOUT: constants {
  1362. // CHECK:STDOUT: %T: type = bind_symbolic_name T, 0 [symbolic]
  1363. // CHECK:STDOUT: %T.patt: type = symbolic_binding_pattern T, 0 [symbolic]
  1364. // CHECK:STDOUT: %ImplicitNotDeducible.type: type = fn_type @ImplicitNotDeducible [template]
  1365. // CHECK:STDOUT: %ImplicitNotDeducible: %ImplicitNotDeducible.type = struct_value () [template]
  1366. // CHECK:STDOUT: %CallImplicitNotDeducible.type: type = fn_type @CallImplicitNotDeducible [template]
  1367. // CHECK:STDOUT: %CallImplicitNotDeducible: %CallImplicitNotDeducible.type = struct_value () [template]
  1368. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template]
  1369. // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template]
  1370. // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: Core.IntLiteral} [template]
  1371. // CHECK:STDOUT: }
  1372. // CHECK:STDOUT:
  1373. // CHECK:STDOUT: imports {
  1374. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  1375. // CHECK:STDOUT: import Core//prelude
  1376. // CHECK:STDOUT: import Core//prelude/...
  1377. // CHECK:STDOUT: }
  1378. // CHECK:STDOUT: }
  1379. // CHECK:STDOUT:
  1380. // CHECK:STDOUT: file {
  1381. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  1382. // CHECK:STDOUT: .Core = imports.%Core
  1383. // CHECK:STDOUT: .ImplicitNotDeducible = %ImplicitNotDeducible.decl
  1384. // CHECK:STDOUT: .CallImplicitNotDeducible = %CallImplicitNotDeducible.decl
  1385. // CHECK:STDOUT: }
  1386. // CHECK:STDOUT: %Core.import = import Core
  1387. // CHECK:STDOUT: %ImplicitNotDeducible.decl: %ImplicitNotDeducible.type = fn_decl @ImplicitNotDeducible [template = constants.%ImplicitNotDeducible] {
  1388. // CHECK:STDOUT: %T.patt.loc4_25.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  1389. // CHECK:STDOUT: %T.param_patt: type = value_param_pattern %T.patt.loc4_25.1, runtime_param<none> [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  1390. // CHECK:STDOUT: %x.patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = binding_pattern x
  1391. // CHECK:STDOUT: %x.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = value_param_pattern %x.patt, runtime_param0
  1392. // CHECK:STDOUT: %y.patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = binding_pattern y
  1393. // CHECK:STDOUT: %y.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = value_param_pattern %y.patt, runtime_param1
  1394. // CHECK:STDOUT: %return.patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = return_slot_pattern
  1395. // CHECK:STDOUT: %return.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = out_param_pattern %return.patt, runtime_param2
  1396. // CHECK:STDOUT: } {
  1397. // CHECK:STDOUT: %T.ref.loc4_50: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  1398. // CHECK:STDOUT: %T.param: type = value_param runtime_param<none>
  1399. // CHECK:STDOUT: %T.loc4_25.1: type = bind_symbolic_name T, 0, %T.param [symbolic = %T.loc4_25.2 (constants.%T)]
  1400. // CHECK:STDOUT: %x.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = value_param runtime_param0
  1401. // CHECK:STDOUT: %T.ref.loc4_38: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  1402. // CHECK:STDOUT: %x: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name x, %x.param
  1403. // CHECK:STDOUT: %y.param: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = value_param runtime_param1
  1404. // CHECK:STDOUT: %T.ref.loc4_44: type = name_ref T, %T.loc4_25.1 [symbolic = %T.loc4_25.2 (constants.%T)]
  1405. // CHECK:STDOUT: %y: @ImplicitNotDeducible.%T.loc4_25.2 (%T) = bind_name y, %y.param
  1406. // CHECK:STDOUT: %return.param: ref @ImplicitNotDeducible.%T.loc4_25.2 (%T) = out_param runtime_param2
  1407. // CHECK:STDOUT: %return: ref @ImplicitNotDeducible.%T.loc4_25.2 (%T) = return_slot %return.param
  1408. // CHECK:STDOUT: }
  1409. // CHECK:STDOUT: %CallImplicitNotDeducible.decl: %CallImplicitNotDeducible.type = fn_decl @CallImplicitNotDeducible [template = constants.%CallImplicitNotDeducible] {} {}
  1410. // CHECK:STDOUT: }
  1411. // CHECK:STDOUT:
  1412. // CHECK:STDOUT: generic fn @ImplicitNotDeducible(%T.loc4_25.1: type) {
  1413. // CHECK:STDOUT: %T.loc4_25.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc4_25.2 (constants.%T)]
  1414. // CHECK:STDOUT: %T.patt.loc4_25.2: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc4_25.2 (constants.%T.patt)]
  1415. // CHECK:STDOUT:
  1416. // CHECK:STDOUT: fn[%T.param_patt: type](%x.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T), %y.param_patt: @ImplicitNotDeducible.%T.loc4_25.2 (%T)) -> @ImplicitNotDeducible.%T.loc4_25.2 (%T);
  1417. // CHECK:STDOUT: }
  1418. // CHECK:STDOUT:
  1419. // CHECK:STDOUT: fn @CallImplicitNotDeducible() {
  1420. // CHECK:STDOUT: !entry:
  1421. // CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [template = constants.%ImplicitNotDeducible]
  1422. // CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [template = constants.%int_42]
  1423. // CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [template = constants.%int_12]
  1424. // CHECK:STDOUT: %.loc14: %struct_type.x = struct_literal (%int_12)
  1425. // CHECK:STDOUT: return
  1426. // CHECK:STDOUT: }
  1427. // CHECK:STDOUT:
  1428. // CHECK:STDOUT: specific @ImplicitNotDeducible(constants.%T) {
  1429. // CHECK:STDOUT: %T.loc4_25.2 => constants.%T
  1430. // CHECK:STDOUT: %T.patt.loc4_25.2 => constants.%T
  1431. // CHECK:STDOUT: }
  1432. // CHECK:STDOUT: